PDA

View Full Version : Carbon Quartz Speed


cloke
2002.06.19, 04:08 PM
I recently moved a sprite game I was working on to 100% quartz. By doing this I was able to simplify my code by a ton and get some pretty cool effects. The problem is that Quartz is so slow. My game went from getting 30FPS to about 17FPS. I know I always read that Quartz is slow, but I was hoping to find a few optimization suggestions.

I was also wondering if there is any downside to mixing QD with Quartz? I have a scrolling background that is done by moving a a view rect around a GWorld (similar to the tutorial found on this site). Then all my sprites are done using the Quartz CG routines. I made the background scroll with CG calls also, but this dropped my frame rate to about 4FPS.

Any suggestions?

wally
2002.06.19, 07:43 PM
I don't know much about quartz but I suspect there are a few things you can try.

Make sure you aren't stretching/scaling anything in the CG calls.

You might try turning of antialising for the CG context.

You might try turning off the alpha channel of the cg context and cg bitmaps (I don't know if this
is possible though).

You might also crack open QuartzDebug() and make sure you don't flush graphics too often. Optimally you want one flush per frame.

This comes from knowing little about CG, but a bit about drawing on Mac OS X and vector drawing, so take it with a grain of salt.

kainsin
2002.06.20, 09:47 AM
Hmmm...please note that I haven't done any Quartz related work yet, but based on what I've read I think that it may be best to stick with QuickDraw if you're making a game and would like speed. To me, Quartz seems to be for applications that display only pictures or text, basically things that only have one frame so they aren't worried about speed at all.

If you want to then you can either keep only the effects you want, or look around on the web for how to programmatically create the desired effects ( like anti-aliasing ) and do it yourself in QuickDraw. It'll probably be much faster.

...Or you can wait for Quartz Extreme and see how well that works. But you'd be requiring your users to have good video cards and at least Jaguar.