• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OpenGL and events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >OpenGL and events (From: "R. Eranki" <email@hidden>)

  • Prev by Date: Re: Static Variable Question...
  • Next by Date: Re: Static Variable Question...
  • Previous by thread: OpenGL and events
  • Next by thread: Use of NSLog() for debugging
  • Index(es):
    • Date
    • Thread