Re: Smooth OpenGL animation possible, even if main thread blocks?
Re: Smooth OpenGL animation possible, even if main thread blocks?
- Subject: Re: Smooth OpenGL animation possible, even if main thread blocks?
- From: Markus Hanauska <email@hidden>
- Date: Mon, 28 Jun 2010 15:01:12 +0200
On Monday, 2010-06-28, at 14:43, vincent habchi wrote:
>> "Possible" or "Allowed"? ;-)
>
> Both, I think. If I am not mistaken, it was some Apple guy (David Duncan?) who pointed out the role of the runloop. I therefore take for granted that, if it is not "allowed", it must at least be "tolerated".
What does work, but I doubt it is allowed, is to directly call 'display' on the CALayer. Apple says "you should not call this method directly", but so far it seems to work and has not crashed... on the other hand it might crash if the CALayer is destroyed on the main thread asynchronously (that can be avoided, though, by making sure the other thread stops first, before the CALayer is ever destroyed). Another issue is that it might cause refreshes of the CALayer, even thought the layer is not even visible right now (e.g. the whole Window is minimized); but that could be solvable, too, though I'm not sure how (querying UI properties of elements from a thread other than main is definitely not thread-safe).
--
Markus Hanauska
_______________________________________________
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