I've been looking at posts like this on how to manage resources like buffers and textures. It makes sense.
https://molecularmusings.wordpress.com/2013/05/17/adventures-in-data-oriented-design-part-3b-internal-references/
Currently I'm using shared pointers to Buffers and Textures. And my geometry objects hold those pointers. It means that if I delete the last model using a particular mesh that the reference count on the buffers will drop to zero and the buffer object will be deleted and the d3d resource has ->Release called. All automatic and safe. And no doubt very slow and inefficient.
If I switched using a handle system like in the article how do people go about managing textures for example?
I would have to somehow know that nothing is using a particual Texture any more and manually call mDevice->DeleteTexture(textureHandle).
So do people implement some form of reference counting inside the Device to count CreateTexure and DeleteTexture on each texture handle? It seems if I'm going to do that I might as well just use a shared_ptr anyway to count it?
EDIT: That might not be the correct link to the website, I wanted the one about using small integer handles. But I cant check because for some reason it's blocked from here...