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.
- lorenz.cc lorenzC.h
- Simple example of how to update via the idle callback and how to use display lists.
- tformColor.c
- Shows how colors blend and transform across objects.
GLUT Interaction
- interact.c
- Demonstrates many of the interaction callbacks available in GLUT. Also shows how to use a timer callback to do constant animation across various hardware platforms.
- rotAndScaleInteractive.c boxNaxis.h
- Demonstrates how to rotate and scale interactively in an intuitive way. This particular example shows how to anti-alias lines and points.
- rotAndScaleInteractive.c surf.h
- Demonstrates how to rotate and scale interactively in an intuitive way. This particular example shows how to do surface shading and lighting.
- rotAndScaleInteractive.c lorenzC.h
- Demonstrates how to rotate and scale interactively in an intuitive way. This particular example shows a good way to use display lists and how to anti-alias.
OpenGL Topics
- lightedSphere.c
- Very simple lighted scene and rotation.