Main loop in Carbon/C++
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:
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
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
That is the standard way of doing things.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Best way to set up your main loop? | Riraito | 6 | 3,999 |
Sep 13, 2008 07:34 PM Last Post: Riraito |
|


