Question

I have a transparent window and want to do 2D drawing in it. I'm considering two options :

  1. Quartz 2D
  2. OpenGL

As I have no experience with Quartz 2D at all, I'm wondering : would it give me better performance? My scene is made out of lines, circles and squares.

Was it helpful?

Solution

It depends if your scene is dynamic, I would use openGL which will have better performance. Using Quartz 2D could be much more easier in terms of code to write. But if you need to refresh your window a lot of time that would cost you.

An other option would be to use both through CALayer. These layers are in fact using openGL for rendering faster. So you can draw inside using Quartz 2D (CAShapeLayer) and then you manipulate the layer to change dynamically your scene. Please bear in mind that if you upscale your layer you'll have artifacts. So, using this technic will give you a Maximum layer size.

I hope I've been clear enough and helpful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top