All GLUT functionality is available through the GLUT FORTRAN API. The GLUT FORTRAN binding is intended to be used in conjunction with the OpenGL and GLU FORTRAN APIs.
A FORTRAN routine using GLUT routines should include the GLUT FORTRAN \ header file. While this is potentially system dependent, on Unix systems this is normally done by including after the SUBROUTINE, FUNCTION, or PROGRAM line:
Though the FORTRAN 77 specification differentiates identifiers by their first six characters only, the GLUT FORTRAN binding (and the OpenGL and GLU FORTRAN bindings) assume identifiers are not limited to 6 characters.
The FORTRAN GLUT binding library archive is typically named libfglut.a on Unix systems. FORTRAN GLUT programs need to link with the system's OpenGL and GLUT libraries and the respective Fortran binding libraries (and any libraries these libraries potentially depend on). A set of window system dependent libraries may also be necessary for linking GLUT programs. For example, programs using the X11 GLUT implementation typically need to link with Xlib, the X extension library, possibly the X Input extension library, the X miscellaneous utilities library, and the math library. An example X11/Unix compile line for a GLUT FORTRAN program would look like:
f77 -o foo foo.f -lfglut -lglut -lfGLU -lGLU -lfGL -lGL \ -lXmu -lXi -lXext -lX11 -lm