GLUT library

From NoskeWiki
Jump to navigation Jump to search


GLUT is the OpenGL Utility Toolkit, a window system independent toolkit for writing OpenGL programs, and often used in software courses to demonstrate 3D programming and OpenGL. It implements a simple windowing application programming interface (API) for OpenGL. The GLUT library has both C, C++ (same as C), FORTRAN, and Ada programming bindings. On this page I've collected some GLUT links I anticipate using again:

GLUT Links

Compiling Glut on Mac

If your OpenGL program has the include library <GL/glut.h>, change this to <GLUT/glut.h> for Mac OS X. If you are including <gl.h> and/or <glu.h>, you'll need to change them to <OpenGL/gl.h> and/or <OpenGL/glu.h>.

The code to compile GLUT on Mac, you have to use frameworks... so:

gcc -framework GLUT -framework OpenGL -framework Cocoa robot.c -o robot

I was able to get some code compiling using:

g++ -I/usr/X11R6/include -L/usr/X11R6/lib glutMaster.o glutWindow.o image.o isnake.o liveWire.o main.o mainWindow.o point.o pq.o contour.o displayWindow.o -o isnake -framework GLUT -framework OpenGL -framework Cocoa -lX11