Original Post
Well the title pretty much explains it.
How should I handle memory when using instancing.
Who owns what, who gets to delete stuff, etc.
I do have a resource manager that uses handles, but for performance reasons I kept it as a wrapper, so that if you really need the performance, you can just do it your own way. The objects also interact without using the resource manager when they own each other in some kind of way.
But that still leaves the problem when two objects own the same thing.
For example, 2 entities own 1 mesh.
Is there a good way to not have to make the programmer pay attention to every single piece of memory, not use all kinds of managers in between objects, and not let the memory dangle until the application shuts down.
To me, there seems to be no perfect solution, but I would like to hear some other thoughts about this.
How should I handle memory when using instancing.
Who owns what, who gets to delete stuff, etc.
I do have a resource manager that uses handles, but for performance reasons I kept it as a wrapper, so that if you really need the performance, you can just do it your own way. The objects also interact without using the resource manager when they own each other in some kind of way.
But that still leaves the problem when two objects own the same thing.
For example, 2 entities own 1 mesh.
Is there a good way to not have to make the programmer pay attention to every single piece of memory, not use all kinds of managers in between objects, and not let the memory dangle until the application shuts down.
To me, there seems to be no perfect solution, but I would like to hear some other thoughts about this.