Useful source code

Sections

Implementations

Headers

Generally Useful Code

SDKs

Toolkits

Conformance Testing and Speed Measurement

Debugging Aids

3D Engines and APIs



Implementations

Mesa, the open source clone of the OpenGL API

(This is the main implementation for Linux, but it can also be built with hardware acceleration for a number of other targets, including Windows, Amiga, Mac etc. The Mesa 3.1 and later source trees, which have been heavily optimised by Keith Whitwell, are in my opinion a good basis for making a fast driver for a target without OpenGL support available. This includes console targets, since Mesa 3.1 and later versions are under the XFree86 license, which does not require developers to distribute the source code for modified versions or supply object code which can be relinked to Mesa, so that console APIs which are under NDA are no longer a problem.)

Source code for SGI's Sample Implementation of OpenGL

(Please note that this is the reference implementation - i.e. the code used by most IHVs as a basis for their drivers - rather than the source code to a hardware accelerated GL. It does not include source for which there are potential licensing issues, such as Intel's assembly code for an optimised geometry pipeline. This FAQ describes the nature of the release in more detail.)

Headers

glext.h

(The creation of a single header file, glext.h, containing all the "official" extensions seems a good idea, and is definitely planned on Linux. This prototype version is for Windows, and at present contains only NVidia supported extensions.)

Generally Useful Code

Michael Gold's site

(The "Advanced OpenGL Game Development Course Information" is well worth a look, especially if you're having trouble specifying your texture formats, and the code samples include multitexture and rasterisation only - OpenGL without the geometry pipeline - examples)

GlutRAD

(GlutRAD is a demonstration radiosity processor, built using OpenGL and GLUT.)

glpng

(glpng is a texture loading library, based on libpng, which directly loads PNGs into OpenGL texture objects. It can also perform other useful tasks, e.g. use the proxy mechanism to check whether a texture can successfully be loaded into a texture object on the current implementation, and automatically downsample the texture until it does fit and then load it if there's a problem.)

SDKs

ATI Rage128 SDK

(Intended for Rage 128 developers, but includes some generally useful material.)

Toolkits

GLUT 3.7 Beta

(GLUT is a cross platform "helper" library for OpenGL. It can be useful for games prototyping. The source is available, but the license specifies that you may not distribute modified versions of the source code.)

freeglut

(freeglut is a clone of GLUT from Pawel Olszta, with a more open - X Consortium style - license so that users can add extra functionality to it as required and freely distribute the modified source code.)

GUT

(GUT - the Grand Unified Toolkit - contains code to perform functions "useful for games" on Linux, Windows, Mac and BeOS, including OpenGL setup and shutdown, going fullscreen in a way compatible with OpenGL, etc.)

GLTT

(This is an OpenGL font handling library which uses truetype fonts.)

GLUI

(Generic user interface toolkit based on OpenGL. The high level GLUT library (see above) is used as support.)

GLOW

(Object oriented GLUT wrapper and set of user interface widgets. In some ways this is similar to GLUI (see above), except for its object oriented design.)

Conformance Testing and Speed Measurement

Glean

(This links to the source and precompiled binaries for glean, an open source suite of tests for OpenGL drivers on X and Win32. See also the downloads section for a version of libtiff which can be easily used to build glean for Win32.)

isfast

(Allen Akin's isfast program is a sample of how to test features on an OpenGL driver to determine whether they run fast enough to be usable on a given implementation (e.g. whether they are hardware accelerated or cause a software default). Code based on this, or on a version of glean (see above) can be run after game or driver installation to determine which features of the API are sufficiently accelerated to be usable on a particular installation.)

Anonymous FTP access for GLPerf and Viewperf

(GLPerf is an application which can be used to test the performance of an OpenGL driver.)

Debugging Aids

GLTrace

(GLTrace allows you to identify exactly what commands an OpenGL program is sending to the API by intercepting and logging calls to the opengl driver. Source code is available. A more developed version for Windows is available from the downloads area.)

OGLMultex

(A useful application which can be used to experiment with texture blending and export source code for specified effects as long as you have a driver which exports ARB_multitexture and EXT_texture_env_combine.)

3D Engines and APIs

Quesa

(This is an open source clone of Apple's discontinued QuickDraw 3D API, running on top of OpenGL on (at present) Linux, Windows and Mac platforms. The license is L-GPL.)

CrystalSpace, an open source 3d engine with OpenGL support

(CrystalSpace runs on a number of targets including Windows. The license is L-GPL.)

Quake 1 Source

(This includes Linux, Windows and OpenGL versions of Quake 1. Note that the OpenGL drivers which Quake 1 / GLQuake used were often mini drivers, so this code may not be a good example of how to use a full OpenGL 1.1 driver. Other systems - e.g. the way in which fullscreen mode is set up on Linux - may also be seriously out of date by modern standards. The license for this code is GPL. A SourceForge project has now been created for patches to the Quake source.)

MGL

(MGL is an open source 3d engine designed for games, available under a Mozilla like license, which is tightly integrated with OpenGL and Mesa.)

3D Engines List

(One of the sub lists references engines using OpenGL, for many of which source is available.)

Back to main