How do I use OpenGL in the lab?

Systems

Currently the only systems that support OpenGL in hardware are the Freedoms and the SGIs. The other HP systems support OpenGL through Mesa, a package that works on all XWindow based platforms. Mesa can be found in /usr/local/mesa.

Makefile

The following Makefile will compile programs that use OpenGL on the Freedoms. I do not have a Makefile to do the same on the SGIs.

Note: Use /usr/local/gnu/bin/make to run this Makefile.

PROGRAM 	= main
C++COMPILER	= g++
CCOMPILER	= gcc
LINKER		= $(C++COMPILER)

SOURCE		= 

CFLAGS		= -g 
LDFLAGS		= -g

INCLUDE 	= 
		-I/usr/include/X11R5 \
		-I/usr/local/include 

HEADERS		= 

OBJECT		= $(patsubst %.C,%.o, $(SOURCE) )

LIBDIRS		= \
		-L/usr/lib/X11R5 \
		-L/usr/local/lib


LIBS		= \
		-lGLU \
		-lGL \
		-lGLb \
		-lXext \
		-lX11 \
		-lXhp11 \
		-lm \
		-ldld

$(PROGRAM) : $(OBJECT)
	$(LINKER) $(INCLUDE) $(LDFLAGS) $(OBJECT) -o $(PROGRAM) $(LIBDIRS) $(LIBS)
	/usr/lib/GL/apptag $(PROGRAM)

depend : 
	/usr/local/bin/X11/makedepend -fMakefile -- $(INCLUDE) -- $(SOURCE) \
	$(HEADERS)

clean :
	rm -f *.o $(PROGRAM) core

%.o : %.C
	$(C++COMPILER) -c $< $(INCLUDE) $(CFLAGS)

%.o : %.c
	$(CCOMPILER) -c $< $(INCLUDE) $(CFLAGS)

# DO NOT DELETE THIS LINE -- make depend depends on it.

Note on compilers

If you are using C++, do not compile with the HP compiler (CC). Your program will compile, but OpenGL output will be either a black window or be garbled. Use g++ instead. If you are using C, either the HP compiler or the GNU compiler will work fine.