FLOOD_OPEN_GL
An OpenGL Demonstration of "Flooding"


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 on Macintosh OS X

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
      

Author:

Art Wetzel

Related Data and Programs:

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.

Reference:

Source Code:

List of Routines:

You can go up one level to the C source codes.


Last revised on 24 March 2008.