https://github.com/falsepattern/zopengl_glgen
OpenGL type-safe wrapper for Zig, built on top of zigglgen
https://github.com/falsepattern/zopengl_glgen
zig-package
Last synced: 5 months ago
JSON representation
OpenGL type-safe wrapper for Zig, built on top of zigglgen
- Host: GitHub
- URL: https://github.com/falsepattern/zopengl_glgen
- Owner: FalsePattern
- License: mit
- Created: 2025-08-04T22:08:40.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-08-07T22:07:39.000Z (6 months ago)
- Last Synced: 2025-08-08T00:11:42.364Z (6 months ago)
- Topics: zig-package
- Language: Zig
- Homepage: https://git.falsepattern.com/falsepattern/zopengl_glgen
- Size: 40 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [zopengl_glgen](https://git.falsepattern.com/falsepattern/zopengl_glgen)
OpenGL type-safe wrapper for Zig, integrated with [zigglgen](https://github.com/castholm/zigglgen).
Based on [zopengl](https://github.com/zig-gamedev/zopengl)
Supports:
* OpenGL Core Profile up to version 4.6
* OpenGL ES up to version 2.0
## Getting started
Example `build.zig`:
```zig
pub fn build(b: *std.Build) void {
const exe = b.addExecutable(.{ ... });
const gl_bindings = @import("zigglgen").generateBindingsModule(b, .{
.api = .gl,
.version = .@"4.1",
.profile = .core,
.extensions = &.{ .ARB_clip_control, .NV_scissor_exclusive },
});
const gl_wrapper = @import("zopengl_glgen").createGLWrapperModule(b, gl_bindings);
exe.root_module.addImport("zgl", gl_wrapper);
}
```
Now in your code you may import and use `zopengl_glgen`:
```zig
const zgl = @import("zgl");
pub fn main() !void {
// Create window and OpenGL context here... (you can use the zig-gamedev `zsdl` or `zglfw` libs for this)
// Also initialize the zigglgen proctable
const gl = zgl.wrapper;
gl.clearColor(0.2, 0.4, 0.8, 1.0);
gl.clear(.{.color = true});
}
```