Getting started with OpenGL
OpenGL is a broad topic in itself, and it is possible to find plenty of tutorials, books, and other resources, usually targeted at C or C++.
Since this chapter is not intended to be a comprehensive guide for this specification, we will take advantage of GLUT, which stands for OpenGL Utility Toolkit. It is widely used in small applications because of its simplicity and portability, and the bindings are implemented in PyOpenGL.
GLUT will help us perform some basic operations, such as creating windows and handling input events.
Tip
GLUT licensing
Unfortunately, GLUT is not in the public domain. The copyright is maintained by its author, Mark Kilgard, who wrote it for the sample programs included in Red Book, the official OpenGL programming guide.
This is the reason we are using freeglut
, one of the open source alternatives that implement the GLUT API.
Initializing the window
The first lines of our script will be the import
statements as well as the definition of our App...