glfw: force init before using init dependent functions
This commit is contained in:
parent
7d47233d7a
commit
400e86888b
1 changed files with 11 additions and 0 deletions
11
glfw/src/internal_debug.zig
Normal file
11
glfw/src/internal_debug.zig
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
const std = @import("std");
|
||||||
|
const zig_builtin = @import("builtin");
|
||||||
|
|
||||||
|
const debug_mode = (zig_builtin.mode == .Debug);
|
||||||
|
var glfw_initialized = if (debug_mode) false else @as(void, {});
|
||||||
|
pub inline fn toggleInitialized() void {
|
||||||
|
if (debug_mode) glfw_initialized = !glfw_initialized;
|
||||||
|
}
|
||||||
|
pub inline fn assertInitialized() void {
|
||||||
|
if (debug_mode) std.debug.assert(glfw_initialized);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue