Re: OpenGL and events
Re: OpenGL and events
- Subject: Re: OpenGL and events
- From: Brendan Younger <email@hidden>
- Date: Sat, 21 Jul 2001 19:28:54 -0500
Rather than using a standard run loop to handle events, timers to render
each frame, &c., is there any way I can make the application run in a
loop
of displaying, updating the view, get events, displaying...?
From my understanding, this is exactly what happens in the standard run
loop.
From the NSView docs:
-setNeedsDisplay:(BOOL)flag
NSViews marked as needing display are automatically redisplayed on each
pass through the application's event loop.
Assuming your display method is tied to a NSTimer, here's what should
happen (each number corresponds to a pass through the run loop):
1. timer fires calling your updating method which in turn calls
-setNeedsDisplay:YES
2. view notices that it's dirty and redisplays, any events posted during
1 or 2 are handled
3. timer fires again, repeat to 1.
Of course, number 2 may take a few more passes through the run loop to
complete processing if there is more than one event to be processed,
but I really think this is probably what you want.
Brendan Younger