1

I'm using the following code to get access to the iOS screen pixels:

int width = 1536;
int height = 2048;
GLubyte *buffer = (GLubyte *) malloc(width * height * 4);
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);

The problem is that buffer is coming back with nothing but zeros. The screen looks fine. Any idea why it would be returning 0's and not the screen data?

glGetError() is returning 0, so I assume there is no error.

This is running on a iPad 3.

genpfault
  • 51,148
  • 11
  • 85
  • 139
Roger Gilbrat
  • 3,755
  • 5
  • 34
  • 58

1 Answers1

-1

Try this solution: Reading data using glReadPixel() with multisampling

Community
  • 1
  • 1
Guru
  • 21,652
  • 10
  • 63
  • 102