GLSim & GLTrace

GLSim is an instrumented implementation of OpenGL. It was written by Ian Buck and Kekoa Proudfoot for students who wish to modify or study the OpenGL pipeline for their projects. GLTrace is a tracing package written by Kekoa Proudfoot for recording and playing back OpenGL traces.

For Linux: glsim.tar.gz
For Windows:

UPDATE 11/12/01.
Fixed texture blending and single buffer mode

For Linux: glsim_v1.1.tar.gz
For Windows:

Trace of Quake3 Demo001 walkthrough: quake3demo001.tlg.gz (62 Megs)
Trace of Unreal walkthrough: unreal.glt.gz (12 Megs)

UPDATE 11/15/01.
Fixed opengl32.lib for windows build. Patch below is for files in "gl" directory.

For Linux: glsim_patch1.tar.gz
For Windows:


Directory structure

Building GLsim

GLsim builds under Linux and Win32. For Linux, type make in the root directory. For Windows, load glsim.dsw in Visual Studio 6.0. Right click on opengl32 project and select build. A successful build will result in (for Linux) or opengl32.dll (for Win32) in the bin directory.

Testing GLsim

Running application using the GLSim OpenGL library other than the system's opengl implementation requires only that you run application from the bin directory. Copy a test application into the bin directory or create a link to the application in the bin directory (Linux only). Also in Linux, make sure that "." is in the beginning of your LD_LIBRARY_PATH which can be checked by running the printenv command. "." can be added by running:
In the bin directory is simple OpenGL application called atlantis. Running this application (or any other GL application) in this directory, you should notice the following text appearing on the command line:
Using GLSim OpenGL Implementation
This indicates that you are using GLsim. Another indicator is speed since rendering with GLSim should be much slower than running with hardware.

Known Issues

GLSim is not a complete OpenGL implementation. The following GL functions are known to be broken: In addition, below are some known issues with GLSim:

Modifing GLSim

For projects which would like to modify the GLSim implementation to do something new, you should first contact the authors at We are here to help you with your projects and can offer advice how to add things like programmable shading, texture caches, etc.

To demonstrate how to add new functionality to GLsim, we implemented a new toy function to the OpenGL api called glMyFunc. glMyFunc keeps two ints around with the OpenGL state for use by the rasterizer. Currently the rasterizer doesn't even look at these values so glMyFunc is quite useless. However it does show how to add a new function to OpenGL.

The files which are effected are:

The state variables defined in glmystate.h are accessible in the renderer code by simply looking into the g->mystate structure.


Directory structure

The glt folder contains the executables for recording and playing traces. It also contains a few sample traces. Playing traces through the GLSim OpenGL implementation is useful for testing with a known stream of OpenGL commands. To play a trace through the GLSim OpenGL implementation, launch the glplay application from the bin directory. Copy (or link) the trace to the bin directory and run the glplay application inside the bin directory.

Need Help?

Please email for any questions or help with this code. If your project will be expanding the functionality of this code, you are encouraged to contact us for how you might implement it.

Good luck!