glfw: update to latest Zig build API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
3d769b9671
commit
06cc7b3115
4 changed files with 47 additions and 38 deletions
|
|
@ -1,13 +1,13 @@
|
|||
const std = @import("std");
|
||||
const zig_builtin = @import("builtin");
|
||||
const builtin = @import("builtin");
|
||||
|
||||
const debug_mode = (zig_builtin.mode == .Debug);
|
||||
var glfw_initialized = if (debug_mode) false else @as(void, {});
|
||||
const is_debug = builtin.mode == .Debug;
|
||||
var glfw_initialized = if (is_debug) false else @as(void, {});
|
||||
pub inline fn toggleInitialized() void {
|
||||
if (debug_mode) glfw_initialized = !glfw_initialized;
|
||||
if (is_debug) glfw_initialized = !glfw_initialized;
|
||||
}
|
||||
pub inline fn assertInitialized() void {
|
||||
if (debug_mode) std.debug.assert(glfw_initialized);
|
||||
if (is_debug) std.debug.assert(glfw_initialized);
|
||||
}
|
||||
pub inline fn assumeInitialized() void {
|
||||
glfw_initialized = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue