【问题标题】:glReadPixels returning all zerosglReadPixels 返回全零
【发布时间】:2012-07-22 02:57:20
【问题描述】:

我正在使用以下代码来访问 iOS 屏幕像素:

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

问题是缓冲区返回时只有零。画面看起来不错。知道为什么它会返回 0 而不是屏幕数据吗?

glGetError() 返回 0,所以我假设没有错误。

这是在 iPad 3 上运行的。

【问题讨论】:

    标签: ios opengl-es


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-15
      • 1970-01-01
      • 2020-11-28
      • 2019-07-16
      相关资源
      最近更新 更多