[SDL] Using OpenGL for image transformations
grimfang4 at hotmail.com
Thu Sep 18 09:06:17 PDT 2008
Okay, I found it. Pretty simple, but if you're new to OpenGL, you might not have seen it.
This sets the rendering destination to the currently bound texture.
I also (re)found this, which is neat:
/* Take snapshot of frame buffer, and store in texture object 1.
* Take snapshot of center 400 by 400 pixels of frame buffer,
* assuming center is at 600, 400.
glBindTexture( GL_TEXTURE_2D, 1 );
glCopyTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, 400, 200, 512, 512, 0);
glBindTexture( GL_TEXTURE_2D, 0 );
The comment is a little off because I changed the values, but you can figure it out. With this, you can copy the current screen to another texture. I used it for a little video screen in-game.
See how Windows Mobile brings your life together—at home, work, or on the go.
More information about the SDL