© 2009 Mitch Richling

Example GLUT Programs

Everybody loves OpenGL, and OpenGL beginners love GLUT! In fact, many seasoned programmers, especially scientific programmers, use GLUT all the time as a primary toolkit for OpenGL. Some windowing toolkits, like FLTK, support GLUT compatibility modes so GLUT skills can often be transitioned to such environments. The example programs on this page are intended to get GLUT beginners, and OpenGL beginners, a few examples to chew on. The makefile is here.

GLUT Basics

helloWorld.c
This little example is a minimal (almost) GLUT program. Uses the glut character drawing function.
mandelbrotGL.c
Demonstrates how to do 2D vector drawing in a pseudo-raster way.
mandelbrotImageGL.c
Demonstrates how to load an RGB image into a GL window
mandelbrotIncImageGL.c
Demonstrates how to draw partial images, and how to use the idle function for background computation.
tformColor.c
Shows how colors blend and transform across objects.

GLUT Interaction

interact.c
Demonstrates interaction and timer callbacks, and constant frame rate animation across various hardware platforms.
rotAndScaleInteractive.c boxNaxis.h
Demonstrates intuitive, interactive rotation/scaling, and anti-aliasing.
rotAndScaleInteractive.c surf.h
Demonstrates intuitive, interactive rotation/scaling, and surface shading and lighting.
rotAndScaleInteractive.c lorenzC.h
Demonstrates intuitive, interactive rotation/scaling, and display lists with anti-aliasing.

OpenGL Topics

lightedSphere.c
Very simple lighted scene and rotation.
© 2009 Mitch Richling