OPENGL is a directory of C programs which demonstrate the use of the OpenGL graphics library.
It is possible to do a wide range of sophisticated 2D and 3D graphics presentations. OpenGL v1.1 software runtime is included as part of the operating system for WinXP, Windows 2000, Windows 98, Windows 95 (OSR2) and Windows NT. The OpenGL v1.1 libraries are also available as a self-extracting archive file from the Microsoft Site via HTTP or FTP.
OpenGL is most commonly used with C or C++ programs, but can also be called by a FORTRAN program if the necessary intermediate "FORTRAN bindings" (an interface package) have been installed.
OpenGL only does graphics rendering, and has no concept of windowing systems, input devices, printing to the screen and so on. These extra functions must be provided by an auxilliary package. One common package as known as GLUT, for the Graphics Language Utility Toolbox.
OpenGL ships with OS9 and OSX for the Macintosh. You can obtain the latest software version on the Apple OpenGL web site.
Note that the source code and compilation script have been adapted for use on a Macintosh running OS X.
For that reason, the include file references have been changed from:
# include <GL/gl.h>
# include <GL/glu.h>
# include <GL/glut.h>
to:
# include <OpenGL/gl.h>
# include <OpenGL/glu.h>
# include <GLUT/glut.h>
The compilation statement, which might ordinarily be
g++ myprog.C -lGL -lGLU -lglut
was modified to:
g++ myprog.C -framework OpenGL -framework GLUT
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
OPENGL examples are available in a C version and a C++ version.
FERN_OPENGL, a C program which uses OpenGL to display the Barnsley fractal fern.
FLOOD_OPENGL, a C program which allows a user to select a region and flood it with color, using OpenGL, by Art Wetzel.
LIFE_OPENGL, a C program which simulates a version of John Conway's "Game of Life", displaying the results using OpenGL.
PPMA, a data directory which describes the ASCII Portable Pixelmap format, which is a possible means of storing the graphics information displayed by OpenGL. One of the example programs shows how this can be done.
LIGHTS_OUT_OPENGL, a C program which sets up a "Lights Out" game and allows the user to solve it, using the OpenGL graphics window.
GASKET_POINTS displays the Sierpinksi gasket by showing 5000 points.
HELLO just draws a blue rectangle.
PLANET draws a wireframe sun and planet. The "d" and "y" keys make the planet rotate and revolve.
TEAPOT draws a teapot. The level of recursion is a command-line argument.
You can go up one level to the C source codes.