views:

62

answers:

1

I've spent about a week reading all the freely available information on iPhone drawing, animation, and OpenGL. Using the available iOS drawing examples like Apple's GLPaint and Quartz sample apps I've written a few versions of a painting tool, but I've hit many limitations which I think is due to "not knowing what I don't know." Quartz is easy to use and fast initially, but slows to a crawl after 20 or 30 paths due to having to rerender the context with every addition. OpenGL stroke rendering seems slow in general (GLPaint app) and makes the UI touches lag and feel "cheap". A search through Amazon and the forums has not revealed any great book or resource recommendations on low level iPhone drawing technologies that could help me become technically proficient enough to write a high performance app with a user experience and visual quality as good as "Brushes" or "Adobe Ideas 1.0". I'm not trying to get free code, I want to learn and I'm willing to pay for learning tools!
Suggestions? Guidance?

Edit: I'm surprised at how few books are out there. I'm making progress, drawing paths that are responsive even when there's many of them and planning an easy undo feature, but still wondering about how to have an erase feature and undo at the same time. Erase will require the scene to be rasterized I suppose, and then undo would have to be done by cacheing screenshots instead of just keeping track of paths.

A: 

Look into CGLayers. This will allow you to cache some of your drawing and not be forced to re-render everything each time it changes, but rather only draw the changes. You'll need to do a little work if you want to add undo/redo support, but this should alleviate some of your performance issues.

Jason Foreman
Thanks for the tip. I got CGLayers working well for my background image, but I didn't use them for the drawing part since that content isn't repeated. I found this link: http://stackoverflow.com/questions/1355527/improving-finger-painting-performance and it gave me a great hint on improving the UI responivness. So what I do is use one UView with Quartz Paths to draw the line currently being painted, and on touchesEnded I push that path class (a mutable path with a color and size variable) into an array of paths stored in a second view below the first which only redraws after a path is ended.
Langosta39