Home

Awesome

KHR Binding C++ Generator

Process

  1. Load XML from Khronos repository
  2. Generate C++ API binding from XML

Preconfigured Profiles

Currently available profiles for loading and generating (in subdirectory profiles):

Examples

Load XML from Khronos repository

python3 update.py -p "profiles/gl.json"
python3 update.py -p "profiles/gles.json"
python3 update.py -p "profiles/glsc.json"
python3 update.py -p "profiles/egl.json"
python3 update.py -p "profiles/vk.json"

Generate C++ API binding from XML

python3 generate.py -p "profiles/gl.json" -d "../glbinding/source"
python3 generate.py -p "profiles/gles.json" -d "../glesbinding/source"
python3 generate.py -p "profiles/glsc.json" -d "../glscbinding/source"
python3 generate.py -p "profiles/egl.json" -d "../eglbinding/source"
python3 generate.py -p "profiles/vk.json" -d "../vkbinding/source"

Profile Documentation

A profile file is a JSON file with a flat layout, although semantic groups are intended. The currently supported tags are:

More options are subject to future development. Ideas and requirements are welcomed.

Example profile gl.json

{
  "": "API specification",
  "apiIdentifier": "gl",
  "sourceUrl": "https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/master/xml/gl.xml",
  "sourceFile": "gl.xml",

  "": "Code Generation",
  "bindingNamespace": "glbinding",
  "baseNamespace": "gl",
  "coreProfileSince": "3.2",
  "multiContext": true,
  "booleanWidth": 8
}

Dependencies