From 455dc26840a94ff15caa3a91046d39d393c4de72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 19 Feb 2017 21:05:00 +0100 Subject: [PATCH] Platform: properly set minimized and cursor window options for GLFW. Didn't work and caused the following error messages to be printed to the output: Invalid window hint 131074 Invalid window hint 208897 --- src/Magnum/Platform/GlfwApplication.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index 7b851e785..ef46be6c5 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -87,7 +87,6 @@ bool GlfwApplication::tryCreateContext(const Configuration& configuration) { #ifdef GLFW_MAXIMIZED glfwWindowHint(GLFW_MAXIMIZED, flags >= Configuration::WindowFlag::Maximized); #endif - glfwWindowHint(GLFW_ICONIFIED, flags >= Configuration::WindowFlag::Minimized); glfwWindowHint(GLFW_FLOATING, flags >= Configuration::WindowFlag::Floating); } glfwWindowHint(GLFW_FOCUSED, configuration.windowFlags() >= Configuration::WindowFlag::Focused); @@ -103,9 +102,6 @@ bool GlfwApplication::tryCreateContext(const Configuration& configuration) { glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, flags >= Configuration::Flag::Debug); glfwWindowHint(GLFW_STEREO, flags >= Configuration::Flag::Stereo); - /* Cursor flags */ - glfwWindowHint(GLFW_CURSOR, Int(configuration.cursorMode())); - /* Set context version, if requested */ if(configuration.version() != Version::None) { Int major, minor; @@ -130,6 +126,12 @@ bool GlfwApplication::tryCreateContext(const Configuration& configuration) { return false; } + /* Proceed with configuring other stuff that couldn't be done with window + hints */ + if(configuration.windowFlags() >= Configuration::WindowFlag::Minimized) + glfwIconifyWindow(_window); + glfwSetInputMode(_window, GLFW_CURSOR, Int(configuration.cursorMode())); + /* Set callbacks */ glfwSetFramebufferSizeCallback(_window, staticViewportEvent); glfwSetKeyCallback(_window, staticKeyEvent);