Changing Picture Every Several Seconds

This is my problem… I need to add a picture on the wall of a room that changes to a different image every several seconds.

What’s the best to implement this in OPENGL?

The easiest solution is to use glTexSubImage.


glBindTexture(GL_TEXTURE_2D,aTextureID);
glTexSubImage2D(GL_TEXTURE_2D,0,0,0,aTextureWidth,aTextureHeight,aTextureFormat,aTextureType,newdata);

This will replace the entire image of the texture bound by glBindTexture. Notice that you must call first and only one time glTexImage2D (with the first image data or NULL if the image is not available at this time) in an init function.

Edit: I suppose that you know how to do texturing in OpenGL, if not read this tutorial

Wow, one of your room wall is an OpenGL surface? That’s totally cool! :smiley: