opengl: support loading global gl functions

This commit is contained in:
Mitchell Hashimoto
2023-02-21 14:03:20 -08:00
parent d368b8e727
commit 807c7fc64d

View File

@ -23,6 +23,10 @@ pub fn load(getProcAddress: anytype) !c_int {
getProcAddress, 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. // try as-is. If this introduces a compiler error, then add a new case.
else => c.gladLoadGLContext(&context, getProcAddress), else => c.gladLoadGLContext(&context, getProcAddress),
}; };