-
why i get a screensnap with OpenGL is black?
glReadBuffer(GL_FRONT);
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
glPixelStorei(GL_PACK_ALIGNMENT,4);
glPixelStorei(GL_PACK_ROW_LENGTH,0);
glPixelStorei(GL_PACK_SKIP_ROWS,0);
glPixelStorei(GL_PACK_SKIP_PIXELS,0);
int width = 1280;
int height = 1024;
int bytewidth = (width*4 +3 ) &~3;
char* raw_data = (char*)malloc( bytewidth* height);
glReadPixels(0,0,width,height,GL_BGRA_EXT,GL_UNSIG NED_INT,raw_data);
glPopClientAttrib();
wxImage image (width,height,raw_data );
image.SaveFile("C:\\test.bmp",wxBITMAP_TYPE_BMP);
-
Re: why i get a screensnap with OpenGL is black?
this code from a mac sample screenshot,and it works ok under mac.
But why can't the windows work?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules