From 807c7fc64d488085de2011ba40069b8f0252959c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 21 Feb 2023 14:03:20 -0800 Subject: [PATCH] opengl: support loading global gl functions --- src/renderer/opengl/glad.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderer/opengl/glad.zig b/src/renderer/opengl/glad.zig index 3ee52431e..e1e763da6 100644 --- a/src/renderer/opengl/glad.zig +++ b/src/renderer/opengl/glad.zig @@ -23,6 +23,10 @@ pub fn load(getProcAddress: anytype) !c_int { getProcAddress, )), + // null proc address means that we are just loading the globally + // pointed gl functions + @TypeOf(null) => c.gladLoaderLoadGLContext(&context), + // try as-is. If this introduces a compiler error, then add a new case. else => c.gladLoadGLContext(&context, getProcAddress), };