got several quads to paint. For each, it´s own texture image is stored in an vector. How many quads are to paint is given by the size of this image vector.
for (int i=0; i < images.size(); ++i)
textures[i] = bindTexture(images[i], GL_TEXTURE_2D);
In my newbee understanding, now the images are transformed in textures and are thrown into the graphic card´s buffer. Am i right?
How to delete or replace one of this texture choosen by index i, like
is used and typicall stl methods are not available?
I don´t want to
glDeleteTextures(all, textures)
and
bindTextures(images[i], GL_TEXTURE_2D)
again, when just repainting the scene, without anything changed in images[]??
To replace texture data, just bind the texture and call glTexImage2D with the new data.
bindTexture, at least the opengl one, just binds a texture name to a specific target, GL_TEXTURE_2D here. It does not delete or replace anything, just put a particular texture in use.
Calling glDeleteTextures will delete specified texture names, then the allowed video memory will be set free by the driver and the texture name free to reuse.