glfw: don't reset hints after window creation

Closes #201
This commit is contained in:
Ali Chraghi 2022-09-17 13:27:06 +04:30 committed by Stephen Gutekanst
parent 797328abe8
commit 0ea0aae968

View file

@ -36,7 +36,7 @@ pub inline fn from(handle: *c.GLFWwindow) Window {
/// @thread_safety This function must only be called from the main thread. /// @thread_safety This function must only be called from the main thread.
/// ///
/// see also: window_hints, glfw.Window.hint, glfw.Window.hintString /// see also: window_hints, glfw.Window.hint, glfw.Window.hintString
inline fn defaultHints() void { pub inline fn defaultHints() void {
internal_debug.assertInitialized(); internal_debug.assertInitialized();
c.glfwDefaultWindowHints(); c.glfwDefaultWindowHints();
getError() catch |err| return switch (err) { getError() catch |err| return switch (err) {
@ -389,7 +389,6 @@ pub inline fn create(
internal_debug.assertInitialized(); internal_debug.assertInitialized();
const ignore_hints_struct = if (comptime @import("builtin").is_test) testing_ignore_window_hints_struct else false; const ignore_hints_struct = if (comptime @import("builtin").is_test) testing_ignore_window_hints_struct else false;
if (!ignore_hints_struct) hints.set(); if (!ignore_hints_struct) hints.set();
defer if (!ignore_hints_struct) defaultHints();
if (c.glfwCreateWindow( if (c.glfwCreateWindow(
@intCast(c_int, width), @intCast(c_int, width),