Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - OpenGL ES rendering to memory glReadPixels: (1 Item)
   
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!