OK, I have just started trying to load more than my two textures so that I can have up to 32766 textures in any given level. I can't figure out how to properly identify the textures though! How should I do this? My level is made up of up to 4billion "objects", each with a texture name. Now I can easily load the texture that each object has, but if I used the same wall texture on 400 walls, this would load my texture 400 times, wasting resources. Even so, how would I then tell OpenGL which texture to bind to?! Here is what I need:
1) Some check to see if a texture of name "x" has been loaded once, and if so, return and don't load it again.
2) A way to tell OpenGL which texture number to bind to after the textures have been loaded and the view is being drawn. Remember, my level data has a NAME for each texture, but OpenGL requires a the number that texture was bound to when it was generated (mip-mapped).
Thanks in advance for any help I can get. Before I was just loading three textures, and easily referencing them with loop data, but for a REALISTIC world we'll need tons of textures per level.