glfw: assert initialized in proc address getter functions

This commit is contained in:
InKryption 2021-11-22 13:11:54 +01:00 committed by Stephen Gutekanst
parent 43b2502e3a
commit da392d89a7
2 changed files with 2 additions and 2 deletions

View file

@ -182,7 +182,7 @@ pub const GLProc = fn () callconv(.C) void;
///
/// see also: context_glext, glfwExtensionSupported
pub inline fn getProcAddress(proc_name: [*:0]const u8) ?GLProc {
// TODO: Do we call 'internal_debug.assertInitialized()' here?
internal_debug.assertInitialized();
const proc_address = c.glfwGetProcAddress(proc_name);
getError() catch |err| @panic(@errorName(err));
if (proc_address) |addr| return addr;

View file

@ -111,7 +111,7 @@ pub const VKProc = fn () callconv(.C) void;
///
/// @thread_safety This function may be called from any thread.
pub fn getInstanceProcAddress(vk_instance: ?*opaque {}, proc_name: [*:0]const u8) callconv(.C) ?VKProc {
// TODO: Do we call 'internal_debug.assertInitialized()' here?
internal_debug.assertInitialized();
const proc_address = c.glfwGetInstanceProcAddress(if (vk_instance) |v| @ptrCast(c.VkInstance, v) else null, proc_name);
getError() catch |err| @panic(@errorName(err));
if (proc_address) |addr| return addr;