问题
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