views:

56

answers:

1

How big of a difference is the description language of Quartz2d to OpenGL ES?

It seems they are similar in description power... except that Quartz is mostly 2d and that OpenGL is out of the box 3d ( but can be made 2d focused ).

Are the mappings from 2dQuartz to 2d OpenGL ES that different? Im sure there must be differences in some specific features that might be handled differently on one vs another... but to do a translator?

Anyone have experience with both OpenGL and Quartz2d have some insights?

+1  A: 

Quartz and OpenGL ES are two completely different animals. While they both have a C-based API that deals with a state machine and that draws into a context, their purposes are dissimilar. In Quartz you specify lines, Bezier and quadratic curves, arcs, or rectangles, as well as fills, gradients, and shadows / glows. In OpenGL ES, you provide vertices, raster textures, and lighting information, from which a scene is generated.

They are both useful in particular cases. You might draw a 2-D static element using Quartz, into a view, layer, or texture, and then place and move that view or layer in 3-D space using Core Animation or do the same for a texture using OpenGL ES.

Rather than try to overlay one API on the other, use whichever is more appropriate for what you are doing, or look to a framework like cocos2d which lets you build and animate 2-D scenes or Core Animation where you can do Quartz drawing into a layer but still use a nicely abstracted API for moving these layers around.

Brad Larson
Cocos seems to just deal with sprites... Im looking for vector ability and transport from vector editing programs ( animation too if possible )It seems that there is already a translation layer between Quartz2d and OpenGL ES because that must be how quartz gets placed into the view anyhow. I found a pathway that lets me get from vector app ( flash ) to Quartz 2d... I would like to get the animation data as well and have it go as close to the hardware level as possible.
tbarbe
@tbarbe - Yes, you use Quartz to draw vector 2-D content that is then rasterized into a Core Animation layer, which is effectively a wrapper around a rectangular OpenGL ES texture. Using Quartz drawing and Core Animation will give you the vector drawing and animation you desire, with a minimal amount of code. You can get a slight bit better performance by dropping down to OpenGL ES, but that will require a lot more code or the use of a framework like cocos2d.
Brad Larson