Jones
2006.07.02, 02:09 PM
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. :)
Thanks!
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. :)
Thanks!