Build Notes

To build the library, follow the following steps:
  1. make realclean
  2. make depend
  3. make all
  4. make run

This walk the src directory, and build two libraries, libmatrix.a and libgle.a. It should then move on and build the demo directory, linking in the above libraries and libglut.a. Finally, this will run the demos in the demo directory.

If you have difficulties... here are some notes:

HP and DEC Systems
HP systems require the compiler -Aa flag to be set to obtain ANSI compiler behaviour. DEC systems require the compiler -std1 flag to be set to get ANSI behaviour. This will help eliminate warning/error messages about function prototypes.
GL and OpenGL libraries
The tubing and extrusion library can be compiled for GL 3.2 or for OpenGL. By default, the Makefile are configured for OpenGL. The Makefiles search for GL/gl.h in /usr/include; if this file is located elsewhere, you will need to modify the Makefiles to point to it. The Makefile assumes that libGL.a is in the default library search path (usually /lib and /usr/lib).

(Warning: the library has NOT been run on GL 3.2 in years, and so might be broken in minor ways. With tweaking, though it should work.)

Obtaining the GL, OpenGL and GLUT libraries
OpenGL is available on most UNIX(R) workstations, as well as OS/2(R) and Windows NT. Contact your workstation vendor for more information; the URL http://www.sgi.com/Technology/openGL/opengl.html points to a variety of information, including a list of OpenGL vendors. GLE also works with Mesa, a public-domain OpenGL-like API. Mesa can be found at http://www.ssec.wisc.edu/~brianp/Mesa.html

The demos require that the GLUT windowing and utility library be installed. GLU can be obtained at http://www.sgi.com/Technology/openGL/glut.html

GLUT Libraries
The demos require the GLUT library and headers to be installed. The Makefiles search for GLUT headers in /usr/local/include, and for the GLUT library in /usr/local/lib

Compile time warnings
You may see some compile time warnings. Ignore these. These occur because not all compilers correctly handle doubly-index subscripts, and so the code does some funny business to get around this. To the best of my knowledge, the code still executes correctly despite these warnings. Note, however, that my efforts to eliminate these warning may result in code that old compilers will not be able to compile, or will compile but not execute correctly.

(In my humble opinion, the way in which the C/C++ language handles doubly, triply, etc. subscripted arrays is fundamentally broken. The syntax is not self-consistent. Many important constructs are undefined by ANSI-C (and C++). In the good old days, when most compilers were broken in this area anway, you could happily work around this with single-index arrays and fancy address calculation. Now that compilers have been fixed, and, thanks to C++, strict-type-checking is all the rage, the fundamental short-comings of C/C++ in this area start becoming horribly appearent.

To put it another way, I agonized over how subscripting should be handled, and what, if any new types needed to be introduced. Sadly, I was unable to design code that compiled on most compilers, AND not introduce new types, AND avoid strict-typechecking warning messages. Sadly, the result is a horrible mess. )

Hacking
If you want to hack, the place to start is with src/inc/port.h which has all of the portability defines in it. Next, start looking at src/tube/ex_raw.c .. enjoy.

To hack textures, read the documentation, then look at texgen.c