I'm making a fairly basic OpenGL 3D engine, at the moment. In this engine, when you load an object, you would write
manager->LoadObjFile("cube.obj"); manager->AddParent("uvmap.bmp", "cube.obj", "cube", glm::vec3(10.0f, 1.0f, 0.0f));
"uvmap.bmp" being the texture, "cube.obj" is the
.obj file path, "cube" being the ID for the object.
My question is, at the moment, when it loads an object, it stores the object in a struct with all of the buffer data and an ID, the ID being the path of the obj file, so when I load an
.obj, it runs through all of the already loaded files and compared the ID of each using
strcmp, which obviously when there's thousands of items, is going to start to get a bit slow.... it does the same for
AddParent, and most of my other methods (different vector of data than where the obj data is stored).
What would be best in terms of identifying items, an integer? I really don't know, I want this to be as high level, user friendly as possible, but want to keep it as optimized and as efficient as possible.