Timeline for A good way to build a game loop in OpenGL
Current License: CC BY-SA 2.5
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 5, 2013 at 23:51 | comment | added | bobobobo | GLUT is not about writing games. It is about writing cross platform OpenGL demos. That is all Kilgard intended it for. You should avoid using it for any larger projects or games, but it is completely fine for smaller games or demos. | |
| Feb 26, 2011 at 14:26 | vote | accept | Jeff | ||
| Feb 18, 2011 at 22:51 | comment | added | charstar | @Ricket Technically, glutMainLoopEvent() handles incoming events by calling the registered callbacks. glutMainLoop() is effectively { glutMainLoopEvent(); IdleCallback(); } A key consideration here is that, redrawing is also a callback handled from within the event loop. You can make an event-driven library behave like a time-driven one, but Maslow's Hammer and all that... | |
| Feb 18, 2011 at 13:54 | comment | added | Ricket | You still have to handle system events though, no? My understanding was that by using glutIdleFunc, it just handles the (in Windows) GetMessage-TranslateMessage-DispatchMessage loop and calls your function whenever there is no message to be gotten. You'd do that yourself anyway, or else suffer the OS's impatience in flagging your application as unresponsive, right? | |
| Feb 18, 2011 at 9:19 | comment | added | Jari Komppa | +1 for ditching GLUT for anything else. As far as I know, GLUT was never meant for anything but test applications. | |
| Feb 18, 2011 at 9:07 | comment | added | charstar | Unfortunately not. All callbacks registered in GLUT are fired off from within glutMainLoop as the event queue is drained and it iterates. I added some links to alternatives in the answer body. | |
| Feb 18, 2011 at 9:04 | history | edited | charstar | CC BY-SA 2.5 |
Clarified that you hand over your main loop with GLUT. Added some links to additional windowing context libraries.
|
| Feb 17, 2011 at 18:26 | comment | added | Jeff | Good article. So to do this in OpenGL, I wouldn't use the glutMainLoop, but instead my own? If I did that, would I be able to use the glutMouseFunc and other functions? I hope that makes sense, I'm still pretty new to all this | |
| Feb 16, 2011 at 9:34 | history | edited | charstar | CC BY-SA 2.5 |
Tried to clarify why the glut callback specifically is a bad idea.
|
| Feb 16, 2011 at 2:15 | history | answered | charstar | CC BY-SA 2.5 |