Re: Hiding the Window Content View
Re: Hiding the Window Content View
- Subject: Re: Hiding the Window Content View
- From: Alastair Houghton <email@hidden>
- Date: Fri, 8 Jan 2010 23:39:10 +0000
On 8 Jan 2010, at 20:46, David Blanton wrote:
> I am just trying to find the best way to do rapid drawing with no flicker.
The answer to that question depends rather on what you mean by "rapid" and on what you're trying to draw.
The fastest way to draw on Mac OS X is generally OpenGL; it's also somewhat lower level than most of the alternatives, and unless you need to use it for some other reason it's usually best to go with something higher level.
For general drawing (including controls and the main views of the majority of applications), Quartz is usually more than fast enough; that's true even for fairly complex animation, though there may be better alternatives for various kinds of animated content. Quartz usually also gives you the best rendering quality, if that matters to you, and has the significant advantage of device independence (so you can draw to a printer just as easily as to the display).
If you want to do the kinds of animations you often see in apps these days, or in the demo programs Apple shows off in some of its presentations, Core Animation is the way to go. You can use that from a view's animator, using layer-backed views, or by creating CALayers yourself.
Finally if you're doing image processing, you might want to investigate Core Image and/or the Accelerate framework functions (vImage, vDSP et al).
In addition, you can do many of these things without any code by using Quartz Composer...
There are probably other things I haven't mentioned as well... this is just OTOH.
As for flicker, for OpenGL obviously you're going to want to configure things for double buffered operation, and you might care about display synchronisation too (see QA1385 and QA1521). The higher level APIs flush the window buffers automatically in a manner that is synchronised with display refresh so you won't see tearing---though the implication, of course, is that there's a maximum rate at which you can draw before the system starts to throttle your updates (see TN2133). If you're using Core Animation, you need not worry about this at all as it handles the issue for you.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden