Reputation: 317
I have an array of 2D textures initialized in OpenGL ES 2.0:
textures[10];
After I delete one of the textures at a given array index:
glDeleteTextures(1, &textures[5]);
How do I remove the empty gap left in my array, with relative ease, in order to keep things neat and tidy? Is there a more direct method other than rendering each texture and then using glGetTexImage
as a way to change the order of the textures in the array?
Upvotes: 0
Views: 272
Reputation: 26
The textures array is actually an array of 'names' represented by non-zero integers set by glGenTextures
that represent texture locations on the GPU. As long as you keep track of the valid textures names and what your using them for you can sort the array any way you want.
Upvotes: 1