This library provides a thin, type-safe binding for OpenGL.
// Use classic OpenGL flavour
varvao=gl.createVertexArray();
defergl.deleteVertexArray(vao);
// Use object oriented flavour
varvertex_buffer=gl.Buffer.create();
defervertex_buffer.delete();
Add zgl to yourbuild.zig.zon
with the following command:
zig fetch --save https://github /ziglibs/zgl/archive/[commit_hash].tar.gz
Replace [commit_hash] with the latest commit or tagged release.
Then add the following to yourbuild.zig
:
constzgl=b.dependency("zgl",.{
.target=target,
.optimize=optimize,
});
exe.root_module.addImport("zgl",zgl.module("zgl"));
Then import it withconst gl = @import( "zgl" );
,and build as normal withzig build
.
This library is developed incrementally. That means that functions and other things will be included on-demand and not just for the sake of completeness.
If you think a function is missing, fork the library, implement the missing function similar to the other functions and make a pull request. Issues that request implementation of missing functions will be closed immediatly.
This library includes OpenGL 4.5 bindings, generated byzig-opengl.Bindings for a different version may be substituted by replacingbinding.zig.