I am making my custom engine for a school project. I have come up with a Resource Management concept for my engine but not sure if there is any better or improvement to be made.
First of all, if a programmer in my team wanted to create a resource, he has to do the following,
So in the component will have TextureHolder* pointing to the object stored in my resource manager. The reason for having so many classes just for one resource is to avoid crashing in midway while using our editor. Example, in Editor mode, I have an object that has a component that has TexutreHolder* point to somewhere in resource manager, the texureInteface is pointing to Texture A, and when the user deletes Texture A, the resource manager will assign EmptyTexture to the TextureInterface* inside the TextureHolder, so now the object has a TextureHolder that inside is pointing to an EmptyTexture and when it calls a function it will just call the TextureInterface function and print some message. This prevents the Editor from crashing.
I am trying to think a better way, but this seems to be the only way to avoid the texture in the component having a nullptr after it was deleted.