Ahsan Habib
|
OpenGL ES rendering to memory glReadPixels
|
Ahsan Habib
08/27/2010 6:29 AM
post64729
|
OpenGL ES rendering to memory glReadPixels
Hi all,
I am drawing something well on QNX-Car system ok.And I also want a " screen shot" of the framebuffer.Here is the key
code:
char *image;
image = (char *)malloc(width * height * 3 * sizeof(png_byte));
....(drawing )
glFlush();
glFinish();
image = (png_byte *)malloc(width * height * 3 * sizeof(char));
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, (unsigned char *)image);
But I can't get anything in the memory address of image?
Can some one give me hints or codes about how to use glReadPixels of OpenGL ES under QNX-Car system.
Thanks!
|
|
|