【发布时间】:2012-09-24 22:16:19
【问题描述】:
我将 GLKViewController 与 GLKView 一起使用,在 ios5 上工作正常,在 io6 更新后 glReadPixels 停止工作,并且只返回黑色像素。
我读过一些关于 preserveBackBuffer 的文章,但还没有成功
我的 GLKView 设置:
_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
if (!_context) {
DLog(@"Failed to create ES context");
}
GLKView *view = (GLKView *)self.view;
view.context = _context;
可能的解决途径? (我在这里尝试过,但还是不行)
CAEAGLLayer * eaglLayer = (CAEAGLLayer*) view.layer;
eaglLayer.drawableProperties = @{kEAGLDrawablePropertyRetainedBacking : @(YES)};
我正在使用 glReadPixels 在着色器处理后记录相机
- (void)captureOutput:(AVCaptureOutput *)captureOutput
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
fromConnection:(AVCaptureConnection *)connection
接受所有帮助,谢谢,
【问题讨论】:
标签: iphone ios graphics eaglview eaglcontext