

		  Instructions for Using GLUT with Mesa


Mark Kilgard's GLUT (OpenGL Utility Toolkit) is a toolkit for quickly
and easily writing OpenGL demos and simple applications.  It's much nicer
than the aux and tk toolkits.  Mark's implementation of GLUT depends on
the OpenGL/X interface GLX.  Mesa's pseudo-GLX functions work well enough
to support GLUT.

GLUT has been used successfully with Mesa on many systems.  If you have
problems contact Brian Paul if you think the problem is caused by Mesa.
Contact Mark Kilgard, or post to the Mesa mailing list, if you think the
problem is in GLUT.

Note that Mesa 1.2.2 requires GLUT 2.2 or later.

Here's how to build GLUT 2.3 using Mesa:

1. Ftp to sgigate.sgi.com and go to the pub/opengl/xjournal/GLUT directory.
   Get the glut.2.3.tar.Z file.  Make sure your copy ends up in this dir-
   ectory  (i.e. Mesa/GLUT/).

2. Unpack the GLUT distribution file with:
	zcat glut.2.3.tar.Z | tar xvf -

3. Make a backup copy of Glut.cf in case you want the original:
	cp Glut.cf Glut.cf.orig


4. If you're using a Sun with Solaris then define the following two
   environment variables from your shell:

	OGLHOME	to where you've installed Mesa (maybe /usr/home/brian/Mesa)
	OPENWINHOME to something like /usr/openwin

   Otherwise, edit Glut.cf as follows:

	change:		EXTRA_INCLUDES = -I$(TOP)
	to look like:	EXTRA_INCLUDES = -I$(TOP)/../include -I$(TOP)

	change:		OPENGL = -lGL
	to look like:	OPENGL = $(TOP)/../lib/libMesaGL.a

	change:		GLU = -lGLU
	to look like:	GLU = $(TOP)/../lib/libMesaGLU.a

   NOTE: if you made shared Mesa libraries, the suffixes might be .so instead
   of .a

5. Run the mkmkfiles.imake script:
	mkmkfiles.imake

6. Run make:
	make

7. If all goes well there should be some executables in the progs/
   directories for you to try out.

8. You may want to copy the lib/glut/libglut.a file to wherever you have
   your Mesa libraries (libMesaGL.a, libMesaGLU.a, etc) if you're going to
   use it for your own work.

