09-02-2022, 11:35 AM
(This post was last modified: 09-02-2022, 11:37 AM by josemendez.)
(09-02-2022, 10:52 AM)lufydad Wrote: But can the number of pooled particles be changed in runtime ?
No. That wouldn't be pooling, would it?
The whole point of a memory pool is to avoid runtime allocation and garbage collection. Allocating memory at runtime is costly, and sets you up for GC. That's why pooling is used as a strategy to create/destroy things at runtime: you create as many "things" (in this case, particles) as you'd possibly need, and just activate/deactivate them at runtime. Changing the size of the pool at runtime would defeat its purpose.