glDeleteTextures(total, &Item::texture[0]);
glGenTextures(total, &Item::texture[0]);
Iteration for all images, total;
glBindTexture( GL_TEXTURE_2D, Item::texture[i] );
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, t.width(), t.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, t.bits() );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
Tries to reload the textures, however it does not. Textures stay the same, unchanged. Any ideas how this could/should be handled? For clarity, I'm trying to reload a texture with a new one, preferably without changing the number of the texture (since there can be a lot of changes).
I'm working with Qt, C++. The code above is in a static function in a seperate GLwidget.
i
. Something smells funny.. – karlphilliptotal
is the count of textures and the second parameter the array start pointer. But why delete and recreate the textures again and again when just the data changes? – Stefan Hanke