OpenGL

OpenGL is an application programming interface (API).
It is not a language.

Python, C++, Java, Fortran, etc. are languages.
The OpenGL API can be used within any of them, assuming it is implemented for that language.

The API defines a set of functions and symbols (constants), and defines exactly what they do.

The actual implementation of the OpenGL API (the "binding") takes the form of a programming library (or a "module", in Python-speak).





OpenGL uses the model of a "pipeline".
Commands and data are fed into the pipeline, processing is done, and the result (an image) comes out the other end (the display).

This fits with the way 3D graphics works on most modern computers - using a graphics card separate from the CPU.
A program runs on the CPU, and it feeds OpenGL commands and data to the graphics card, which performs the rendering and displays the image on a monitor.

What we will study in this class is the set of commands that OpenGL provides, that are used to make a graphics card draw a 3D scene.
We will learn the meaning of these operations, but we won't cover their underlying implementation (that's something for CS480).







GLUT

OpenGL consists of commands related to drawing 2D & 3D objects (e.g. draw a triangle, define material properties, define a texture).
This drawing takes place in some sort of window, controlled by an operating system. But OpenGL avoids including any sort of functions to create or manipulate these windows, or to do other user interface tasks like reading the keyboard and mouse.

GLUT, the GL Utility Toolkit, provides functions related to windowing and interaction. It defines a very simple interface that hides the OS-specific details of these tasks.
This means that GLUT functions can be used in the same way under Unix, MacOS, and Windows, making GLUT-based programs more portable.




GLUT also provides an "event loop" programming model, which is appropriate for many interactive graphics programs.







Other libraries exist that can be used instead of GLUT for windowing and user interface tools (e.g. SDL, raw X Windows).
However, our purpose in this class is to learn about OpenGL, so we'll stick with GLUT as a simple learning tool.









next