azant
08-08-2008, 02:23 PM
I am trying to do a screen capture and write it to a jpeg file. My understanding is that the framebuffer will contain whats being rendered to the display and using PixelRead should grab whats in the framebuffer. What I am seeing is just a black image rather than whats rendered on the display.
GLubyte* pixelBuffer = new GLubyte[sizeof(GLubyte)*width*height*3];
glReadBuffer(GL_FRONT);
GLint ReadBuffer;
glGetIntegerv(GL_READ_BUFFER,&ReadBuffer);
glPixelStorei(GL_READ_BUFFER,GL_RGB);
GLint PackAlignment;
glGetIntegerv(GL_PACK_ALIGNMENT,&PackAlignment);
glPixelStorei(GL_PACK_ALIGNMENT,1);
glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixelBuffer);
Any ideas on what I am doing wrong? I am developing on a Dell Optiplex GX620 with an Intel 82945G/GZ graphics controller.
OpenGL Driver Info
==================
Vendor: Tungsten Graphics, Inc
Version: 1.4 Mesa 7.1 rc1
Renderer: Mesa DRI Intel(R) 945G 20061102 x86/MMX/SSE2
Color Bits(R,G,B,A): (8, 8, 8, 8)
Depth Bits: 24
Stencil Bits: 8
azant
GLubyte* pixelBuffer = new GLubyte[sizeof(GLubyte)*width*height*3];
glReadBuffer(GL_FRONT);
GLint ReadBuffer;
glGetIntegerv(GL_READ_BUFFER,&ReadBuffer);
glPixelStorei(GL_READ_BUFFER,GL_RGB);
GLint PackAlignment;
glGetIntegerv(GL_PACK_ALIGNMENT,&PackAlignment);
glPixelStorei(GL_PACK_ALIGNMENT,1);
glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixelBuffer);
Any ideas on what I am doing wrong? I am developing on a Dell Optiplex GX620 with an Intel 82945G/GZ graphics controller.
OpenGL Driver Info
==================
Vendor: Tungsten Graphics, Inc
Version: 1.4 Mesa 7.1 rc1
Renderer: Mesa DRI Intel(R) 945G 20061102 x86/MMX/SSE2
Color Bits(R,G,B,A): (8, 8, 8, 8)
Depth Bits: 24
Stencil Bits: 8
azant