crazyfuturamanoob
November 15th, 2008, 06:15 PM
How to get screen capture with OpenGL and save into an existing texture on the fly?
I tried this:
GLuint ScreenCapture( )
{
GLuint texture;
glReadPixels( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, GL_RGB, GL_UNSIGNED_INT, &texture );
return texture;
}
Result: Freezes for a couple seconds before Segmentation Fault.
Oh yes, and language is C again.
I tried this:
GLuint ScreenCapture( )
{
GLuint texture;
glReadPixels( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, GL_RGB, GL_UNSIGNED_INT, &texture );
return texture;
}
Result: Freezes for a couple seconds before Segmentation Fault.
Oh yes, and language is C again.