glDeleteTextures() not working...

Hi!
I’ve got some problems with unbinding my textures:

I splitted up a large image in some small parts for displaying them with OpenGL as textures, works fine for the first loaded picture, but as soon as I load a new one, the old one is still displayed (the GlCanvas is properly refreshed,means I can move the image in space and so on). I try to unbind the textures with

private void deleteTextures(GL gl){
for(int i = 1;i<tmp.length;i++)
{
gl.glDeleteTextures(i,tmp);
}
}
where tmp is the intarray which holds the texturesnames.
After calling this function I bind the new texture the same way like the previous one, but with the effect described above. Any suggestions what I could have done wrong?

t.i.a.

basti

Ok, i just found the problem :slight_smile: I was to lazy to read the syntax of glDeleteTextures() correctly . You just need to call gl.glDeleteTextures(tmp.length,tmp) once (not in a loop) to delete all textures previously loaded.

greetings

basti