where to start with an OpenGL painter for the Retina display

孤人 提交于 2019-12-11 03:43:28

问题


I understand that i can't adapt GLPainter example from apple to retina due to a bug mentioned here: Problems displaying full-screen CAEAGLLayer on Retina iPad

Any one knows a good starting point to creating an Open-GL basic painter with brushes, that will work on Retina?

or - creating an openGL painter without CAEAGLLayer


回答1:


I think that the starting point can still be GLPaint, only you need to set to NO hte value of kEAGLDrawablePropertyRetainedBacking and change the way you draw in your GL view.

GLPaint will only render to the gl buffer the strokes you draw by touching the screen, relying on kEAGLDrawablePropertyRetainedBacking to make the full buffer content retained. An alternative might be redrawing at each step the full content of the buffer. This would require keeping track of all the strokes that were drawn and kind-of "replay" them.

I suspect that in any serious painting app you would not rely on kEAGLDrawablePropertyRetainedBacking to retain the buffer content due both to performance and the need for managing you own data structure representing the painting (for anything like storing, sending the painting etc.) and would therefore implement your own solution for it.



来源:https://stackoverflow.com/questions/11276027/where-to-start-with-an-opengl-painter-for-the-retina-display

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