Most of what I know about OpenGL, I learned from Nehe. But the examples tend to be rather "vanilla" (which is good), and don't fit every situation.
One thing I'd like to do, that I can't seem to find an example of, is to have some sort of more dynamic texture management.
Here is what I mean - in order to load textures into OpenGL, I need to tell it how many textures to make space for, like this:
glGenTextures(2, &texture[0]);
Those textures get referenced by storing an int in an array, and passing that value to reference the texture:
glBindTexture(GL_TEXTURE_2D, texture[1]);
Now I can draw a quad (or whatever) and apply the texture to that.
What I'd LIKE to be able to do is something more like this:
CTextures Textures;
..
Textures.LoadImage("myimage.bmp","MyImage");
..
glBindTexture(GL_TEXTURE_2D, Textures.Texture("MyImage"));
Does that make sense? In other words, 2 things are going on here. First, I don't know ahead of time how many images I'm going to load, it happens dynamically. Second, I can reference the image by name instead of by integer, making things a little more clear, readable, and dynamic.
Has anyone done this? Any examples you can share?
-Todd"Windows dectected that your mouse has moved. Please reboot for the changes to take effect"