ipad 3 - openGL bug with kEAGLDrawablePropertyRetainedBacking and retina?

只愿长相守 提交于 2020-01-09 09:54:09

问题


i have an iOS openGL app which uses the kEAGLDrawablePropertyRetainedBacking property to draw the current frame on top of the previous frame. it's a cheap way of getting effects like motion trails.

it works great on all devices (including iPhone w/ retina) and all device simulators, but on the actual iPad 3 device, the previous frame is vertically squished to 75% of its previous size.

for example, if i were to draw a 100 x 100 square at the bottom of the screen each frame, then in frame 0 i have one square, in frame 2 there's an echo that's 100 x 75 and offset towards the top of the screen, in frame three there's an additional echo that's 100 x 56 (56 ~= 75 * 0.75) and is more offset towards the top, and so-on. what should happen is that all the echoes remain in place.

i've verified the behavior on two devices, so i don't think it's a just a broken iPad.

any ideas ?

tia, orion


回答1:


I was seeing this bug. I don’t know anything about OpenGL, so I couldn’t really dig into solving it with textures, as has been suggested, but in my case I was able to switch to a very fast implementation of Quartz 2D drawing based on a tutorial from http://blog.effectiveui.com/?p=8105, plus how to make it work on Retina from https://stackoverflow.com/a/10870188/255489. It actually ended up being much faster than the code I had borrowed from Apple’s GLPaint sample code.




回答2:


This was a confirmed bug with retained backing and the Retina iPad in iOS 5.x. It has since been fixed in iOS 6.0 and higher.



来源:https://stackoverflow.com/questions/9753230/ipad-3-opengl-bug-with-keagldrawablepropertyretainedbacking-and-retina

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!