glfw: add assumeInitialized for external GLFW initialization
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
383d5f4d6e
commit
e4b790e9f4
2 changed files with 11 additions and 0 deletions
|
@ -9,3 +9,6 @@ pub inline fn toggleInitialized() void {
|
|||
pub inline fn assertInitialized() void {
|
||||
if (debug_mode) std.debug.assert(glfw_initialized);
|
||||
}
|
||||
pub inline fn assumeInitialized() void {
|
||||
glfw_initialized = true;
|
||||
}
|
||||
|
|
|
@ -41,6 +41,14 @@ pub usingnamespace @import("mod.zig");
|
|||
|
||||
const internal_debug = @import("internal_debug.zig");
|
||||
|
||||
/// If GLFW was already initialized in your program, e.g. you are embedding Zig code into an existing
|
||||
/// program that has already called glfwInit via the C API for you - then you need to tell mach/glfw
|
||||
/// that it has in fact been initialized already, otherwise when you call other methods mach/glfw
|
||||
/// would panic thinking glfw.init has not been called yet.
|
||||
pub fn assumeInitialized() void {
|
||||
internal_debug.assumeInitialized();
|
||||
}
|
||||
|
||||
/// Initializes the GLFW library.
|
||||
///
|
||||
/// This function initializes the GLFW library. Before most GLFW functions can be used, GLFW must
|
||||
|
|
Loading…
Add table
Reference in a new issue