This library provides a thin, type-safe binding for OpenGL.
// Use classic OpenGL flavour
var vao = gl.createVertexArray();
defer gl.deleteVertexArray(vao);
// Use object oriented flavour
var vertex_buffer = gl.Buffer.create();
defer vertex_buffer.delete();Add zgl to your build.zig.zon with the following command:
zig fetch --save https://github.com/ziglibs/zgl/archive/[commit_hash].tar.gz
Replace [commit_hash] with the latest commit or tagged release.
Then add the following to your build.zig:
const zgl = b.dependency("zgl", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("zgl", zgl.module("zgl"));