Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

OpenGL loader interface, bindings and optional type-safe wrapper for Zig.

License

NotificationsYou must be signed in to change notification settings

zig-gamedev/zopengl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenGL loader interface, bindings and optional type-safe wrapper for Zig.

Supports:

  • OpenGL Core Profile up to version 4.6
  • OpenGL ES up to version 2.0

Getting started

Examplebuild.zig:

pubfnbuild(b:*std.Build)void {constexe=b.addExecutable(.{... });constzopengl=b.dependency("zopengl", .{});exe.root_module.addImport("zopengl",zopengl.module("root"));}

Now in your code you may import and usezopengl:

constzopengl=@import("zopengl");pubfnmain()!void {// Create window and OpenGL context here... (you can use our `zsdl` or `zglfw` libs for this)tryzopengl.loadCoreProfile(getProcAddress,4,0);constgl=zopengl.bindings;// or zopengl.wrapper (experimental)gl.clearBufferfv(gl.COLOR,0, &.{0.2,0.4,0.8,1.0 });}fngetProcAddress(name: [*:0]constu8)callconv(.c)?*constanyopaque {// Load GL function pointer here// You could use `zsdl.gl.getProcAddress() or `zglfw.getProcAddress()`}

About

OpenGL loader interface, bindings and optional type-safe wrapper for Zig.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp