A fully Zig OpenGL bindings generator, for dynamically loading or through a static interface.
Updated for Zig 0.13.0.
Uses edqx/dishwasher to parse the OpenGL XML Spec.
In your build.zig, you can use the generateBindingsModule
method from the generator's build script:
const openglBindings = @import("zig-opengl-bindings");
...
const opengl = openglBindings.addBindingsModule(b, .{
.api = "gles2",
.version = "GL_ES_VERSION_3_0",
.static = false,
});
...
executable.root_module.addImport("opengl", opengl);
Building the standalone binary is as simple as:
zig build -Doptimize=ReleaseFast
You can then run the script with
./zig-out/bin/zig-opengl-bindings gles2 GL_ES_VERSION_3_0 out.zig
Add --static
for a static interface