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>
# include <OpenGL/gl.h> # include <OpenGL/glu.h> # include <GLUT/glut.h>
The compilation statement, which might ordinarily be
was modified to:
g++ myprog.C -lGL -lGLU -lglut
g++ myprog.C -framework OpenGL -framework GLUT
OPENGL examples are available in a C version and a C++ version.
CAUSTIC_OPENGL, a C++ program which computes a caustic curve and displays it using OpenGL.
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.
TET_MESH_DISPLAY_OPENGL, a C++ program which reads a pair of files defining a tetrahedral mesh and displays an image using OpenGL.
TRIANGULATION_DISPLAY_OPENGL, a C++ program which reads a pair of files defining a triangulation and displays an image using OpenGL.
XY_DISPLAY_OPENGL, a C++ program which reads an XY file of 2D point coordinates, and displays an image of those points using OpenGL.
XYZ_DISPLAY_OPENGL, a C++ program which reads an XYZ file of 3D point coordinates, and displays an image of those points using OpenGL.
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.