diff --git a/flake.lock b/flake.lock index ac956830c..1e411fca0 100644 --- a/flake.lock +++ b/flake.lock @@ -109,11 +109,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1666872658, - "narHash": "sha256-o7bZWBdkoCnpN4E0tJZ3mOYJFy0AG4HoSqOfdnQLiw4=", + "lastModified": 1667045313, + "narHash": "sha256-vKrdqq66EF35cjArFQfKmXXPdft+3BiNyjDoR9boYLo=", "owner": "mitchellh", "repo": "zig-overlay", - "rev": "22bdb1d6b2e313acf185a2f43bd39c5c25f369ae", + "rev": "0c9b9364efc23e3765601a583f963e704cc8a919", "type": "github" }, "original": { diff --git a/src/opengl/glad.zig b/src/opengl/glad.zig index 84e08ff00..4ab3e6642 100644 --- a/src/opengl/glad.zig +++ b/src/opengl/glad.zig @@ -35,14 +35,10 @@ pub fn unload() void { context = undefined; } -pub fn versionMajor(res: c_int) c_uint { - // https://github.com/ziglang/zig/issues/13162 - // return c.GLAD_VERSION_MAJOR(res); - return @intCast(c_uint, @divTrunc(res, 10000)); +pub fn versionMajor(res: c_uint) c_uint { + return c.GLAD_VERSION_MAJOR(res); } -pub fn versionMinor(res: c_int) c_uint { - // https://github.com/ziglang/zig/issues/13162 - // return c.GLAD_VERSION_MINOR(res); - return @intCast(c_uint, @mod(res, 10000)); +pub fn versionMinor(res: c_uint) c_uint { + return c.GLAD_VERSION_MINOR(res); } diff --git a/src/renderer/OpenGL.zig b/src/renderer/OpenGL.zig index d6658b5ff..eaf2d319a 100644 --- a/src/renderer/OpenGL.zig +++ b/src/renderer/OpenGL.zig @@ -430,8 +430,8 @@ pub fn threadEnter(self: *const OpenGL, window: glfw.Window) !void { }); errdefer gl.glad.unload(); log.info("loaded OpenGL {}.{}", .{ - gl.glad.versionMajor(version), - gl.glad.versionMinor(version), + gl.glad.versionMajor(@intCast(c_uint, version)), + gl.glad.versionMinor(@intCast(c_uint, version)), }); }