[NEWBIE] Background tasks
[NEWBIE] Background tasks
- Subject: [NEWBIE] Background tasks
- From: Brent Gulanowski <email@hidden>
- Date: Tue, 28 Aug 2001 21:06:40 -0400
How does one get the event loop to give up a slice of processor time every
time through the loop? I'm thinking that overriding NSApplication's -run
would be way beyond me. Starting a new thread I think is also more than I
wanted right now, but if that's what it takes... I'm trying to do an OpenGL
animation, but I can't find a way to register an Idle-type function. I'm
shaky on this point: is there an event posted every run around the event
loop? Every clock tick? If I just override -sendEvent: (and can be assured
it gets called every run around the loop) then I have my answer. But what
risk am I taking overriding it?
Can I do something like
-(void)sendEvent:(NSEvent *)anEvent
{
//filter out any events I need in the ViewPort
[super sendEvent:anEvent];
[modelController updateModel];
}
?
Will this get called repeatedly by the Window Server?
bg
--
Void where prohibited.