Original Post
Hello! I'm doing some texture binding but I have a strange problem. The program is written in java, using JOGL for OpenGL. When I initialize the textures in a for loop, I do the following, an it works fine: but... If I do the following, only textures[1] is working: Notice that textures[0] and textures[1] are exchanged in if and else blocks... What is wrong ?!?
if (u == 1) {
gl.glBindTexture(GL.GL_TEXTURE_2D, textures[1]);
}
else {
gl.glBindTexture(GL.GL_TEXTURE_2D, textures[0]);
}
if (u == 1) {
gl.glBindTexture(GL.GL_TEXTURE_2D, textures[0]);
}
else {
gl.glBindTexture(GL.GL_TEXTURE_2D, textures[1]);
}