Introdution
-----------

ogltrace - An OpenGL tracing utility library.  This utility is useful
           for analyzing an OpenGL application to determine the 
           graphics requirements.  Output can be a trace of the
           OpenGL API calls made by an application, or additional
           statistics information.  This utility library functions
           as a wrapper around the system OpenGL library and is
           designed in such a way that additional functionality can
           easily be added as required.

Files
-----

dll.c		- Contains main shared library entry point which
                  checks environment variables and allocates memory
                  when DLL or DSO is loaded by an application.
                  Tracing behaviour controlled by environment
                  variables outlined below.

ogltrace.c     - Functions which trace OpenGL calls.

state.c        - Functions which handle tracing of state information.

wgltrace.c     - Functions which trace WGL calls.

xgltrace.c     - Functions which trace GLX calls.

Setup
-----

NT

Building makefile creates opengl32.dll.  Put this DLL in the
applications directory or into another directory in the LIB
path ahead of the directory which containts the system opengl32.dll.

IRIX:

Building makefile creates libogltrace.so.  Use this DSO
by setting the following environment variable.

setenv _RLDN32_LIST directory/libogltrace.so:DEFAULT

This directs the runtime linker to resolve the OpenGL, and
GLX symbols in this DSO before resolving them in libGL.so.

LINUX:

Building makefile create libGL.so.  Set then environment
variable LD_LIBRARY_PATH to include the directory which contains 
this DSO.  The directory should be placed in the LD_LIBRARY_PATH
ahead of any directory that may contain the systme OpenGL DSO.
When the application executes, the run-time loader will
resolve the OpenGL and GLX symbols using this DSO.  Use the
linux 'ldd' command to verify that the application locates the
correct libGL.so and that the version number is correct.  It
may be necessary to rename the DSO to add a version number.

Usage
-----

Behaviour is controlled by a set of environment variables.  Use
the environment variables to control the output from the tracing
utility.

The following environment variables control the output of OpenGL
trace information to a text file.

OGL_TRACE  : If set, OpenGL API call trace is output to file
             ogltrace.txt.

OGL_NODATA : If set, application data not put in OpenGL trace 
             file inorder to reduce the size of the resulting file.  
             Only applies if OGL_TRACE is also set.


The following environment variables control the output of 
additional graphics statistics.

OGL_STATI  : If set, OpenGL statistics information output to 
             console window.

OGL_STATMAT : If set, output statistics on glMaterial calls in 
              console window.  Only applied if OGL_STATI is also set.

OGL_STATABLE : If set, output statistics on glEnable/glDisable 
               calls in console window.  Only applies if OGL_STATI 
               is also set.

OGL_STATPRIM : If set, output stats on OpenGL primtive calls in 
               console  window.  Only applies if OGL_STATI is also set.

OGL_STATRECORD : If set, output per frame trace of the primitive 
                 statistics in the file statrecord.txt 

OGL_ONSWAP : If set, statistics refresh on each swapbuffer call. 
             If not set, default is to refresh on each glClear call.
             This environment variable should not be set for a
             single buffered application which does not make
             swapbuffer calls, otherwise no output will be produced.

