What is Galogen?

Galogen is an OpenGL loader generator. Given an API version and a list of extensions, Galogen will produce corresponding headers and code that load the exact OpenGL entry points you need. The produced code can then be used directly by your C or C++ application, without having to link against any additional libraries.

Galogen uses the Khronos OpenGL Registry as its source of truth, thus ensuring that the produced code always corresponds to the latest specifications.

Supported Platforms

Galogen runs on Windows and Linux. It also runs in the browser, thanks to Emscripten. The generated loading code works on Windows and Linux.

Contacting the Author

Please file bugs and feature requests on GitHub.


Obtaining Galogen

Prebuilt x86_64 binaries of Galogen are available for Windows and Linux.

In case you use other platforms, building from source is quick and easy:

To run Galogen, you will need the OpenGL API registry, which is a single XML file. A copy of it comes with the prebuilt binaries, as well as with the source code distribution. If you would like to use the most up-to-date version, please obtain it from Khronos' official GitHub repo.

You may also consider using the in-browser version of Galogen.


The Friendly Manual

Generating a Loader Using The Command-Line Version

Run Galogen from the command line like so:
galogen <path to the API registry XML file> <options>

The latest version of the API registry file can be obtained from Khronos' official GitHub repository.

Supported options:

As an example, the following command will generate code for loading OpenGL 4.3 core with anisotropic texture filtering extension and write it to files named "gl43.h" and "gl43.c":
galogen gl.xml --api gl --version 4.3 --profile core --exts EXT_texture_filter_anisotropic --filename gl43

Using the Loader Code in Your Application

You may simply drop the generated files into your C++ or C project and use them directly. You do not need to include the system GL headers: simply including the Galogen-generated header file is sufficient, as it has all the necessary declarations.

Note that you still need to link against opengl32.lib on Windows, and against libGL on Linux.


Credits

Galogen is developed and maintained by nicebyte.

TinyXML2 library by Lee Thomason.