Bits and Pieces for OpenGL Games Development

gluBuild2dMipmaps using Hardware Rendering (All Targets)

Simple stripifier code module, suitable for use with OpenGL (All Targets)

Quake 3 Mac Initialisation Code (Mac Specific)

X Video Mode Extension Sample (Linux Specific)

Dynamic Loading API for Windows (Windows Specific)

GLTrace version 2.2 Source and Binary (Windows Specific)

GLTrace version 2.21 Source and Binary (Windows Specific)

3dfx Windows Standalone Driver Library File (Windows Specific)

3dfx Windows Standalone Driver GLU dll (Windows Specific)

Dynamically Loadable Windows GLU Source (Windows Specific)

Mesa 3.0 D3D Driver Source (version 2) (Windows Specific)

Libtiff for Win32 (binaries and source) (Windows Specific)

Mesa 3.1 for Win32 / FX binary (Windows Specific)

Mesa 3.2 for Win32 / FX binary (Windows Specific)

Credits

gluBuild2dMipmaps using Hardware Rendering (All Targets)

This is a replacement for gluBuild2dMipmaps which uses the driver's (usually hardware) filtering to generate better mipmaps. It was contributed by Leigh McRae, who writes:

This function is a special version of the GLU function. This version of the function uses the graphic adapter's filtering to generate the different levels. This should make for better quality mipmaps and might even be faster, although speed isn't the point. The function works the same except for a couple of things. First the call will trash your back buffer so this function shouldn't be used during a frame. Also it is uncertain how an alpha texture will work out since most drivers still don't do destination alpha. So caller beware...

View the mipmap2d.txt file

Simple stripifier code module, suitable for use with OpenGL (All Targets)

This is based on Brad Grantham's meshifier code, but has been adapted to always produce strips with a defined winding order. Some minor bugs have also been fixed. The output strip data should be suitable for use with OpenGL, and may be as good as that produced by much more sophisticated algorithms for "real" game data, which (in my experience, at least) often contains enough different textures and so on that it never stripifies especially well.

Download the mesh.zip file (Windows zip format)

Quake 3 Mac Initialisation Code (Mac Specific)

This is Quake 3's initialisation code for the Mac version. Note that Geoff Stahl of Apple rewrote a lot of it before the final version of Q3 (the newer version should be released at some point), but this is the (working) code included in several Mac test releases.

View the q3agl.txt file

X VideoModeExtension Sample (Linux Specific)

This is a copy of the open source SDL utilities from Loki Games which is more advanced than those available in the normal downloads as of 9th December 1999, and includes a function (sdl_SetFullscreenWindow in sdl_utils.cpp) which demonstrates how to use the X VideoModeExtension to change the screen resolution to be the same as that of your game (i.e. "go fullscreen") on Linux with X Windows. This is development code, and not as clean as released versions of SDL normally are (e.g. the sdl_SetFullscreenWindow function only has a Unix version in this download). The included files are sdl_utils.h, sdl_utils.cpp and sdl_pcx.c

Please note that this file is provided solely as a demonstration of how to use the extension until such time as the normal SDL distribution includes all the required functionality, at which point I may remove this download to minimise confusion)

Download the vidmode.zip file (Windows zip format)

Download the vidmttar.gz file (Unix tar / gz format)

Dynamic Loading API for Windows (Windows Specific)

This is code from Ryan Haksi which demonstrates how to dynamically load 3dfxvgl.dll (the "standalone" driver for Voodoo 1, 2 or Rush on Windows), opengl32.dll (the normal Microsoft ICD driver for 2d / 3d cards under Windows), or a mini GL driver. It will also dynamically load the appropriate copy of the glu dll if you are using glu (see below for a glu dll which can be used with 3dfxvgl.dll). It should be possible to plug this code into an existing project based on using ICD drivers only via a static link to opengl32.lib and glu32.lib (the default Microsoft libraries) with a minimum of code reorganisation, to allow your game to easily use the "standalone" 3dfx driver. Using this code you can also set up your game so that an end user can select Voodoo 1 or 2 or default ICD rendering at runtime if their PC contains both a Voodoo 1 or 2 and a 2d / 3d card with an accelerated OpenGL driver. For more information, see Ryan Haksi's dynamic loading page.

Download the dynload.zip file (Windows zip format)

GLTrace version 2.2 Source and Binary (Windows Specific)

This is an improved version of the original GLTrace code, which intercepts OpenGL calls made by an application and logs them to an output file. This is done by replacing the normal GL dll with one which records all the calls made and then sends them on to the driver. The download includes a prebuilt binary as well as the source and various makefiles.

The GLTrace code is under a GPL license. This version includes modifications to the original made by Phil Frisbie, Keith Harrison and Petr Sebor; if many more people want to work on it, it might be worth considering setting up a SourceForge project.

Download the gltrace2.zip file (Windows zip format)

GLTrace version 2.21 Source and Binary (Windows Specific)

This download is identical to the GLTrace 2.2 download, except that additional modifications have been made by Carl Adahl. Specifically, support has been added for EXT_texture_env_combine, NV_texture_env_combine4 and NV_texgen_reflection, and glTexEnvf and glTexEnvi now support GL_RGB_SCALE_EXT and GL_ALPHA_SCALE. All the comments for GLTrace v 2.2 apply to this version as well.

Download the gltre221.zip file (Windows zip format)

3dfx Windows Standalone Driver Library File (Windows Specific)

3dfxvgl.lib is a Microsoft Visual C 6 .lib file built, by a process too hideous to describe, from 3dfxvgl.dll, the 3dfx standalone OpenGL 1.1 driver for Voodoo 1, 2 and Rush on Win32. It is suitable for static linking to 3dfxvgl.dll, and can be used (e.g.) to produce a glu dll which works with 3dfxvgl.dll, or to link your entire application to 3dfxvgl.dll, so that instead of using dynamic loading on Win32 to handle the choice between ICD drivers loaded via the Microsoft opengl32.dll and the 3dfxvgl.dll driver, you can statically link to both and have two executables which you install depending on the drivers you want to use.

Download the 3dfxvgl.zip file (Windows zip format)

3dfx Windows Standalone Driver GLU dll (Windows Specific)

vx3dfxglu.dll is a build of glu which can be used with 3dfxvgl.dll on Windows until such time as 3dfx provide their own glu which can be used with the standalone driver for Voodoo 1, 2 and Rush. The issue here is that (due to the way Windows dynamic linking works) the dlls from which a dll imports must be set at build time. Thus neither glu32.dll (which imports from opengl32.dll) or glu.dll (which imports from SGI's opengl.dll for Windows) can be used with 3dfxvgl.dll.

Note that:

1) Since this dll is based on the Mesa 3.0 source, it corresponds to a slightly earlier version of glu than is provided by glu32.dll and glu.dll, and not all the functions available in glu32.dll and glu.dll are present. However, all the functions which people normally seem to use (e.g. gluPerspective, gluUnProject etc) are there. vx3dfxglu.txt (linked below) is a dump of the imports and exports for the vx3dfxglu.dll file which documents what glu functions are available.

2) This dll is intended to be used by people dynamically loading 3dfxvgl.dll, which means you will also need to dynamically load the glu dll appropriate to your choice of OpenGL dll (3dfxvgl.dll, opengl32.dll, opengl.dll etc). Sample code for dynamic loading, including dynamic loading of glu, should appear shortly in the developer section of the GLSetup web site, or you can ask for pointers on the OpenGL gamedev list (see External Links for pointers to subscription information).

3) Since this dll is based on Mesa 3.0, which is distributed under the L-GPL license, if you intend to ship it on a game CD you should either include the source on your CD or (at minimum) provide a link to a site from which the source can be downloaded. The main repository for Mesa source code is at www.mesa3d.org.

Download the vx3dfxglu.zip file (Windows zip format)

View the vx3dfxglu.txt file

Dynamically Loadable Windows GLU Source (Windows Specific)

vxglu.zip contains all the source used to build vx3dfxglu.dll as a Visual C 6 project. Note that this is all you would want to put on a CD if you ship vx3dfxglu.dll. Also note that this code could be used to statically link to vx3dfxglu.dll if you are statically linking to 3dfxvgl.dll (since it can be used to make a .lib file for vx3dfxglu.dll). It can also be used to make Win32 glu dlls for OpenGL dlls on Win32 other than opengl32.dll (for which glu32.dll comes with the Windows 9X OS as of Win95 OSR2, or can be installed via a patch on the Microsoft ftp site; see External Links), SGI's opengl.dll (for which glu.dll comes with the SGI OpenGL for Windows distribution) or 3dfxvgl.dll (see vx3dfxglu.dll above).

The zip file contains a Visual C 6 project file which can be used to build it from the IDE.

Download the vxglu.zip file (Windows zip format)

Mesa 3.0 D3D Driver Source (version 2) (Windows Specific)

altogl_5.zip is the source for Leigh McRae's second version of the Mesa 3.0 D3D driver, i.e. it is a D3D wrapper which provides OpenGL 1.2 functionality on Win32 cards which provide at least some level of acceleration but don't have a native OpenGL 1.1 driver (this basically means a small number of old cards, e.g. Matrox G100, Rendition V1000, PowerVR PCX2). This source is one generation beyond what I believe to be in the current (as of 29th November 1999) Mesa source trees, and is faster and more stable than the first version, with a number of bug fixes and the ability to run on a PowerVR PCX2 if "optimised rendering" is turned off from the driver control panel. Note that it is still a Mesa 3.0 rather than 3.1 or 3.2 driver, however.

Use "nmake /f makefile.d3d" to build the source, after editing the makefile to describe where your copy of the DirectX SDK is located etc and setting up Visual C for command line builds. The DirectX SDK is available as part of the MSDN and DirectX CD distributions. New versions are generally also available for download from the Microsoft DirectX site for a limited time after the initial release. A mirror of recent DXSDK versions is also maintained at the OmarVision site, in the "downloads" section.

The prebuilt binary for this source can be downloaded from the alt.software web site (OpenGL section).

This binary is called altogl.dll; the normal way of using it is to rename it to opengl32.dll and put it in a position where the application will load it before the Microsoft dll in windows \ system (e.g. in the application directory) but not actually copy it over the Microsoft version, since that would break the ICD mechanism.

Note that this is a Windows 9X driver; on Windows NT Direct3D is stuck at the DirectX 3 version for want of a kernel patch and cannot provide hardware acceleration in any case. However, this driver should be usable (possibly with small modifications to the source) on Windows 2000, which supports DirectX 7.

Download the altogl_5.zip file (Windows zip format)

Libtiff for Win32 (Binaries and Source) (Windows Specific)

Libtiff is traditionally a little tricky to build for Windows, but is required to make Allen Akin's Glean software. This file contains a slightly hacked version of the libtiff source which can be made on Win32 using "nmake /f makefile.w95" (with Visual C set up for command line builds) and a prebuilt .lib and headers which can just be plugged into the glean make process.

Download the tiff_win32.zip file (Windows zip format)

Mesa 3.1 for Win32 / FX Binary (Windows Specific)

This is a build of the final released version of Mesa 3.1 for Win32 / Glide support. While this build may have some bugs, especially on a Voodoo 1, it is not much slower than 3dfx's own current drivers on a Voodoo 2 or 3 and offers some features that they do not, notably working alpha interpolation on texel data before alpha tests and the ability to render in a window on Voodoo 1, 2 and Rush hardware if the MESA_WGL_FX environment variable is set to "window". The source for Mesa 3.1 is available from the Mesa site. The ability to render in a window without using WinGlide (which has serious "issues" with the version of Glide included with the current 3dfx drivers) means this build may at minimum be useful for development work and debugging on e.g. a Voodoo 2. Note that the binary I've made available here does not include optimised assembly code for 3dNow! and Katmai or Voodoo 2 specific optimisations, although they are in the source.

Unlike the "official" 3dfx OpenGL drivers for Windows, there is only one Mesa driver binary for Voodoo 1, 2, 3, Rush and Banshee cards.

Note that when Mesa is compiled for Win32 it produces a binary called opengl32.dll; to avoid problems with the operating system, this should be put in a position where the application will load it before the Microsoft dll in windows \ system (e.g. in the application directory) but not actually copied over the Microsoft version.

Download the mesafx31.zip file (Windows zip format)

Mesa 3.2 for Win32 / FX Binary (Windows Specific)

This is a build of Mesa 3.2 (stabilised version of 3.1) for 3dfx / Windows support, from a snapshot of the development source taken on the 20th of February 2000, with an additional patch (now added to the main Mesa source trees) that prevents it crashing on boards with one TMU (e.g. Voodoo 1 or Rush cards) when texturing is enabled. Note that this binary was built with assembly language support disabled, since I did not have a Pentium III or 3DNow! enabled AMD CPU to hand to test the optimised geometry routines. Like Mesa 3.1, it can be used for windowed rendering on a Voodoo 1, 2 or Rush card if the environment variable MESA_WGL_FX is set to "window".

At least as far as the game I'm working on is concerned, this version is actually superior to the current (as of mid February 2000) release of the "official" 3dfx drivers, since it appears to be bug free. The performance, both with my application and with Quake 3, is generally in the region of 90-95% of that obtained with the "official" drivers, even without assembly optimisations.

Note that there may be significant bugs and slowdowns outside the general area of the "Quake 3 path" described in e.g. John Carmack's notes on optimising OpenGL drivers for Quake3. You may wish to take particular care when experimenting with display lists or compiled vertex arrays.

Note also that when Mesa is compiled for Win32 it produces a binary called opengl32.dll; to avoid problems with the operating system, this should be put in a position where the application will load it before the Microsoft dll in windows \ system (e.g. in the application directory) but not actually copied over the Microsoft version.

Please send any bug reports to mesa-bugs@mesa3d.org, or use the Mesa Bugs Database.

Download the mesafx32.zip file (Windows zip format)

Credits

The 3dfx standalone driver library and dll files, and the altered versions of the Mesa 3.0 glu code and Libtiff, were produced at VX (Special Projects) by Neal Tringham.

The second version of the Mesa 3.0 D3D driver was written by Leigh McRae at alt.software, with support from alt.software and Ubisoft.

John Carmack of ID Software wrote the Quake 3 Mac initialisation code.

The Windows dynamic loading API was written by Ryan Haksi of Borealis Technology Management.

The original GLTrace code was written by John Miles; modifications for version 2.2 were made by Phil Frisbie, Keith Harrison and Petr Sebor. Additional enhancements for version 2.21 were contributed by Carl Adahl.

The vidmode.zip file was contributed by Michael Vance of Loki Games, and includes SDL code written by various developers.

The alternative version of gluBuild2dMipmaps which uses hardware rendering was contributed by Leigh McRae (email leigh@mail.altsoftware.com with any feedback about this function).

The original version of the "meshifier" stripification code was written by Brad Grantham while at SGI. Additional changes for this version were made by Neal Tringham at VX.

Thanks go to Brian Paul and the Mesa developers, especially Keith Whitwell and Daryll Strauss, for the Mesa glu source and Mesa 3.1 / 3.2 for 3dfx / Win32.

Please note: the contributors listed by name on this page have requested a mention in the credits section for any publically released project which actually uses one of these downloads. Many of the downloads come with licensing terms (e.g. XFree86) which require this.

Some of the files on this page also have other (generally not very irksome) licensing requirements. Specifically, Ryan Haksi has requested that a copy of any improvements made to the Dynamic Loading API for Windows code be mailed to him at cryogen@infoserve.net so he can maintain an up to date copy.

Mesa 3.0 is under an L-GPL license, although 3.1 and later versions have moved to XFree86. This means that any binaries shipped based on modified Mesa 3.0 code should include either the source or a link to a web page where that source can be found. Since the only Mesa 3.0 based downloads available here are the dynamically loadable / 3dfx standalone glu code and the second version of the Mesa 3.0 D3D driver, and the source for both of these is on this page, a link to this site (http://www.pseudonymz.demon.co.uk) in the credits should satisfy the license, assuming that you have not made significant further modifications to the source.

The "meshifier" stripification code is copyrighted by Brad Grantham, with all rights reserved. I have the right to distribute my changed version of the source, but if you want to distribute another version incorporating your own changes you should contact Brad Grantham directly (a contact email address is included in the readme for the download). There are no restrictions on your use of this code, bug fixes you might want to make for your own use, etc. (And if you do fix a bug in this version, I'd be grateful if you could mail me the result so I can fix the download)

Finally, GLTrace (all versions) is under a GPL license. This means that the source for both GLTrace and all code linked to it must be made publically available. Since GLTrace is a debugging tool which is used as a standalone dll, this is unlikely to have any practical consequences unless you want to improve the source in the download, in which case you should make your changes available somehow. I would be happy to host source downloads for any improved versions of GLTrace 2 if you do not have web site space available (my email address is on the front page of the site). If you do decide to ship the existing binary for GLTrace 2 on a game CD for some reason, a link to http://www.pseudonymz.demon.co.uk in the credits should satisfy the license requirements, as for Mesa 3.0 above.

Back to main