FLOOD_OPEN_GL is a C program, using GLfloat arithmetic, which demonstrates the idea of "flooding", that is, filling one region of an image with a color, using OpenGL.
The program begins by displaying an image of a white background upon which are a series of wavy black lines. If the user clicks the mouse in a given region, a random color is chosen, and the entire region is filled with that color. That's it!
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
gcc flood_open_gl.c -lGL -lGLU -lglut
was modified to:
gcc flood_open_gl.c -framework OpenGL -framework GLUT
Art Wetzel
LIFE_OPEN_GL is a C++ program which plays John Conway's "Game of Life", using OpenGL to display the results.
OPEN_GL is a C++ example directory which demonstrates the use of OpenGL for graphics applications.
You can go up one level to the C source codes.