I’m trying to display a cube shaped room that is staticly textured, so I use a texture object, and in the forground I have a quad displaying video. I want to load the static texture using a texture object, and load the video frames into another texture that I can update on the foreground quad.
The rendering code is something like this:
glClear(…)
glPushMatrix()
glRotate(…)glBindTexture(GL_TEXTURE_2D, integer_for_texture_object);
glCallList(integer_to_cube_display_list);
glPopMatrix
// then, to render the animated-texture quad,
// I do
glPushMatrix();
glLoadIdentity();glTexImage2D(GL_TEXTURE_2D, 0, 3, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, pointer_to_current_frame_rgb_data);
glCallList(integer_to_foreground_quad);
glPopMatrix();
What ends up happening is that the cube walls also get rendered with the frames of my animation - I never see my original texture stored in the texture object.
If I remove the call to glTexImage2D(), then everything gets textured with the texture object, which is what I expect.
What am I missing?