Main loop in Carbon/C++

DaveF
Unregistered
 
Post: #1
Hi

How are you all doing your main loop? I've currently got the basics up, but have thus far only got things working on a timer as follows:

Code:
EventLoopTimerRef myTimer;
EventLoopTimerUPP timerUPP;
timerUPP = NewEventLoopTimerUPP(TimerAction);
InstallEventLoopTimer ( ::GetMainEventLoop(), 0, 1/25.0f, timerUPP, NULL, &myTimer);

Where the `TimerAction' function doing the clearing of buffers, drawing, and swap.

Obviously this is not ideal, but with my limited knowledge of Carbon I'm not sure of any other way to hook into the main event loop. Can anyone suggest the more standard way of doing things?

Thanks


Dave
Quote this message in a reply
Luminary
Posts: 5,125
Joined: 2002.04
Post: #2
That is the standard way of doing things.
Quote this message in a reply
DaveF
Unregistered
 
Post: #3
OK, I've not gone too far off the track then Wink

Ta mate


Dave
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Best way to set up your main loop? Riraito 6 4,002 Sep 13, 2008 07:34 PM
Last Post: Riraito