Skip to content
Projects

ziglibs/zgl has 634 GitHub stars and 69 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-15 15:25 UTC. Last push 2026-05-26.

How these counts are measured

Measured star growth

in 24h
0
in 7 days
Update delayed
in 15 days
Update delayed
in 1 month
Update delayed

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

About

Zig OpenGL Wrapper

Developer Tools

README.md

Original

ZGL – Zig OpenGL Bindings

This library provides a thin, type-safe binding for OpenGL.

Example

// 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();

Installation

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"));

Then import it with const gl = @import("zgl");, and build as normal with zig build.

Development Philosophy

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 immediately.

Generated Bindings

This library includes OpenGL 4.5 bindings, generated by zig-opengl. Bindings for a different version may be substituted by replacing binding.zig.