1

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.

STW
  • 44,917
  • 17
  • 105
  • 161
Fatso
  • 1,278
  • 16
  • 46

1 Answers1

2

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.

Ganzolo
  • 1,394
  • 12
  • 23
  • You have been clear and helpful, thanks. My app is very dynamic, and I already programmed it in openGL in the past which gave me adequate results (300-500fps) but someone told me Quartz might be a better idea, and I wanted to know more about that. – Fatso Feb 24 '12 at 09:51
  • 1
    An other indication for you. I was using quartz to draw a gradient border with a black gradient background. Rescaling on iPad was lagging... – Ganzolo Feb 24 '12 at 09:53