Comparing SDL vs. GLUT's looping system

Post: #1
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...
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. Smile

Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #2
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.
Quote this message in a reply
Post: #3
Thanks! It just seemed strange and a but untidy to jam all my junk into my display loop.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenAL looping sound problem Gillissie 0 5,382 Sep 16, 2010 12:31 AM
Last Post: Gillissie
  Looping a m4a with NSMovieView BeyondCloister 8 6,263 Jan 3, 2006 05:22 PM
Last Post: kelvin
  Seamless audio looping in SDL Joseph Duchesne 4 5,652 Aug 7, 2004 03:41 PM
Last Post: Joseph Duchesne