So I am making a 3D FPS game, but I’m having a problem with a certain theory.
I’ve created a loader function which loads in all the models, textures, sounds, etc that are necessary for the scene to operate. These are abstracts, not any VAO or texture handles. What my problem is, is I need a convention which allows me to index the models from my sets of data.
public class Scene {
public Model[] models;
public Shader[] shaders;
public TextureData[] textures;
public SoundData[] sounds;
}
Instead of keeping track of the number index of course.
[header]
models=2
shaders=2
textures=2
sounds=1
[build]
[model]
res/model/stall.obj
res/model/gui.obj
[shader]
res/shader/;default.vp;default.fp
res/shader/;gui.vp;gui.fp
[texture]
res/texture/cityscape.png
res/texture/example.png
[sound]
res/sound/bum.wav