Hello! Anyone familiar with resources or sample source code that demonstrates screen/page transition effects using plain OpenGL? (Preferably C/C++ and not using QT). Thanks.
+2
A:
If I'm interpreting your question right, you have two scenes rendering in OpenGL, and you wish to move from one to another.
I was programming a game a few years ago, in which I wanted to have a world and a battle screen - just like Final Fantasy. In that, I decided to program a "shattering" effect. In order to do so, I rendered the current scene to a texture, mapped it onto a set of triangles, then moved the triangles away, while rendering the new scene in the background.
In order to get your current scene as a texture, assuming you have a texture object already, you can use glCopyTexSubImage2D, as below:
glBindTexture(GL_TEXTURE_2D, textureID); glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, screenWidth, screenHeight);
Andrei Krotkov
2009-05-04 21:05:05