开发者

iPhone/ipad convert quartz2d line drawing to opengl

This is a completely rookie question but I'm looking for some beginners guidance with opengl. I've got an app that uses quartz 2d to draw static lines on a view. This has been working fine but we are hitting some performance issues on ipad 1 and we don't feel like we can optimize it any more to try and speed it up.

We're looking to rewrite the view to use opengl so we can improve the rendering performance, however we don't have any experience in opengl. I've been looking over the web and playing about but with little success. I've been usi开发者_如何学Pythonng the example provided here (direct link) to get started, but I wondered if someone could write a smidgin of code to show us how to draw a set of lines into the view.


My answer might be judged roughly here anyways I'll tell something from our experience. We were building an iPhone/iPad application which dealed with charts(Line/Column/Pie/...). I was asked to make a research on which technology to use. So finally we selected OpenGL ES as it is much more flexible and low level graphics engine. Finally, when we have met a lot of problems with OpenGL, when drawing these charts in UITableViews, created background threads and loots and lots of adjustments in order to get performance and exclude application crashes, which persisted. At the end we have realized that our charts are not drawn so smoothly as lots of other existing applications do. The architecture drawing frame by frame maybe can be effective, when there are not so much calculations, but in our case it was very slow, even if much of the vertices were precalculated. Finally we decided to pass to Quartz2D and actually we have won the war. All the charts where drawn by the iOS framework, which is native, and is kinda optimized to draw fast and smooth. So if you are trying to draw just a line and you think you will get better performance by passing from quartz to opengl es, my opinion is not to do it. Good luck.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜