r*****y 发帖数: 507 | 1 I tried to get pixel value in frame buffer by glGetPixels function,
but failed.I don't know the reasons.
my code is as follows:
...
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_SWAP_BYTES,0);
glPixelStorei(GL_UNPACK_LSB_FIRST,0);
glPixelStorei(GL_UNPACK_SKIP_PIXELS,1);
glClearColor(1.0f, 1.0f, 1.0f, 1.0f) ;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glFlush();
GLenum errorcode;
// this window size is larger than 100*100.
| l**p 发帖数: 474 | 2 you just cleared your color buffer,,..... so it is 0.
【在 r*****y 的大作中提到】 : I tried to get pixel value in frame buffer by glGetPixels function, : but failed.I don't know the reasons. : my code is as follows: : ... : glPixelStorei(GL_UNPACK_ALIGNMENT, 1); : glPixelStorei(GL_UNPACK_SWAP_BYTES,0); : glPixelStorei(GL_UNPACK_LSB_FIRST,0); : glPixelStorei(GL_UNPACK_SKIP_PIXELS,1); : glClearColor(1.0f, 1.0f, 1.0f, 1.0f) ; : glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
|