I'm currently learning OpenGL by NeHe whilst packing all my knowledge into a C++ Engine. So far, I'm at chapter 6 (textures). The question is:
How can I manage my textures dynamically?
I thought of a dynamically allocated array holding the texture IDs.
Well, I have two options:
1. Allow the user to dynamically delete and add textures, which is practical but also kinda difficult to implement (fill in empty slots etc. so that the ID for a texture doesn't change) and a certain amount of overhead
2. Allow the user to have one dynamically allocated array, only being able to add textures and clear the array entirely. This would be easier, but how can I increase the size of the array and still having old textures work? By repeatedly calling glGenTextures and glTexImage2D?
3. Have one array of a specific size and being able to replace it completely (like number 2 without dynamically adding textures)
I prefer the second choice. But I need help implementing it.
EDIT: I have already searched in the forum, sorry if someone else's asked this before