glfw: always check init errors

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2021-07-17 13:59:26 -07:00
parent 003a1db2e6
commit 26e0db2064

View file

@ -40,10 +40,8 @@ pub const version = @import("version.zig");
///
/// @thread_safety This function must only be called from the main thread.
pub inline fn init() Error!void {
if (c.glfwInit() != c.GLFW_TRUE) {
return try getError();
}
return;
_ = c.glfwInit();
return try getError();
}
/// Terminates the GLFW library.