new opengl function calls for stage2

This commit is contained in:
Mitchell Hashimoto
2022-10-14 09:18:33 -07:00
parent e73db24f0e
commit c99fb89738
2 changed files with 10 additions and 3 deletions

View File

@@ -191,7 +191,10 @@ pub fn create(alloc: Allocator, loop: libuv.Loop, config: *const Config) !*Windo
try glfw.swapInterval(1);
// Load OpenGL bindings
const version = try gl.glad.load(glfw.getProcAddress);
const version = try gl.glad.load(switch (builtin.zig_backend) {
.stage1 => glfw.getProcAddress,
else => &glfw.getProcAddress,
});
log.info("loaded OpenGL {}.{}", .{
gl.glad.versionMajor(version),
gl.glad.versionMinor(version),