Comparing SDL vs. GLUT's looping system
This is not an argument about which is better, SDL or GLUT. I just need some help wrapping my head around how glut's self loop system works, compared to say a simple SDL game loop.
If I were to do a game in SDL, my game loop would probably just be...
But in GLUT, I can't just do that. Or at least I don't think I can...
When using GLUT, as far as I know. It (glut) will automatically just loop whatever you define as being the display, idle functions or keyboard functions etc etc. And this lopp begins with the glutMainLoop(); function. Now, would I just jam all the stuff that would normally be in my game loop in say, SDL, into my display or idle functions? Is it some kind of threading system in the background, ie Display and another function run at the same time?
Sorry, but this is something I need to know.
Thanks!
If I were to do a game in SDL, my game loop would probably just be...
Code:
int isItTimeToQuit = 0;
while (isItTimeToQuit != 1) ... and so on...But in GLUT, I can't just do that. Or at least I don't think I can...
When using GLUT, as far as I know. It (glut) will automatically just loop whatever you define as being the display, idle functions or keyboard functions etc etc. And this lopp begins with the glutMainLoop(); function. Now, would I just jam all the stuff that would normally be in my game loop in say, SDL, into my display or idle functions? Is it some kind of threading system in the background, ie Display and another function run at the same time?
Sorry, but this is something I need to know.

Thanks!
Yes, anything that you would put in the body of your SDL loop, you should put into display or idle. No, there's no threading going on.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenAL looping sound problem | Gillissie | 0 | 3,004 |
Sep 16, 2010 12:31 AM Last Post: Gillissie |
|
| Looping a m4a with NSMovieView | BeyondCloister | 8 | 3,685 |
Jan 3, 2006 05:22 PM Last Post: kelvin |
|
| Seamless audio looping in SDL | Joseph Duchesne | 4 | 3,856 |
Aug 7, 2004 03:41 PM Last Post: Joseph Duchesne |
|

