Skip to main content

OpenGL XML API registry parser

Project description

glreg provides functionality to parse and extract data from OpenGL XML API Registry files. Types, enums and functions (commands) in the registry can be enumerated and inspected. This module also provides functions to resolve dependencies and filter APIs in the registry. This makes it useful for generating OpenGL headers and loaders.

Sample code

Import the module:

>>> import glreg

Load a Registry object from a file:

>>> registry = glreg.load(open('gl.xml'))

Generate a simple OpenGL ES 2 C header:

>>> for api in glreg.group_apis(registry, api='gles2', support='gles2'):
...     print('#ifndef ' +
...     print('#define ' +
...     print(api.text)
...     print('#endif')
#ifndef GL_ES_VERSION_2_0
#define GL_ES_VERSION_2_0
#include <KHR/khrplatform.h>
typedef khronos_int8_t GLbyte;...


  • Python 2.7+, 3.2+


Documentation is available at


glreg is available at PyPI. Simply run the following:

# pip install --pre glreg

Or, if you downloaded the source, run the following from the source directory:

# python install


Please report bugs and feature requests to


MIT License

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for glreg, version 0.9.0a3
Filename, size File type Python version Upload date Hashes
Filename, size glreg-0.9.0a3.tar.gz (9.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page