GLUT stands for OpenGL Utility Toolkit. Mark J. Kilgard implemented it to enable the construction of OpenGL applications that are truly window system independent. Thanks to GLUT, we can write applications without having to learn about X windows or Microsoft’s own window system. Kilgard implemented the version for X windows, and later Nate Robins ported it to Microsoft Windows. Thanks to both, you did a great job.
With GLUT you can open a window for OpenGL rendering with 5 lines of code! Another 3 or 4 lines and you can a keyboard and mouse with your application. GLUT really makes things simple, hence it is very usefull to learn and to build small applications. Although GLUT is not being maintained anymore it still serves its purpose.
The GLUT distribution comes with lots and lots of examples so after you read through the basics in here you’ll have plenty of material to go on. Check out the GLUTs page.
In this tutorial I’ll introduce you to the basics of building an application using GLUT. This tutorial won’t introduce fancy visual effects in order to keep the code as simple as possible. I’ll use OpenGL 2.0 since it is much simpler and avoids complicating the core subject of the tutorial: GLUT.
There are open source versions of GLUT, such as freeGLUT and OpenGLUT. They all kept the API so 99.9% of what will be presented in this tutorial is still valid. Nonetheless these new versions do have some extensions that make it worth a try. Check out the extensions in freeGLUT here.
Please do comment if something is not completely clear. Your feedback is important.
- Moving the Camera I
- Advanced Keyboard
- Moving the Camera II
- The Code So Far
- Moving the Camera III
- The Code So Far II
Avoiding the Idle Func