开发者

TVOutManager with glReadPixels()

开发者 https://www.devze.com 2023-02-07 03:10 出处:网络
I\'m surprised nobody else asked this question. If someone did but I didn\'t find it, please let me know.

I'm surprised nobody else asked this question. If someone did but I didn't find it, please let me know.

I'm looking for a solution s开发者_如何学运维imilar to TVOutManager for mirroring the screen of an iPad/iPhone to an external display. TVOutManager works great, but doesn't display animations and OpenGL content. In the readme file of the above code, Rob mentions a QA from Apple that uses glReadPixels() and apparently does the trick. But I'm not sure how to implement it. The code snippet in the QA works for specific view only. How do I capture the entire window with multiple OpenGL views?


If you have multiple OpenGL views, you will have multiple EAGLContext and/or framebuffers (one for each view). The same way the drawing calls draw to the current framebuffer in the current context, glReadPixels will read the current framebuffer in the current context.

Basically you need to set every view as you were going to draw the next frame (but without the clear call) then you make the glReadPixels() call.

0

精彩评论

暂无评论...
验证码 换一张
取 消