Browse Source

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
pull/193/head
Vladimír Vondruš 9 years ago
parent
commit
455dc26840
  1. 10
      src/Magnum/Platform/GlfwApplication.cpp

10
src/Magnum/Platform/GlfwApplication.cpp

@ -87,7 +87,6 @@ bool GlfwApplication::tryCreateContext(const Configuration& configuration) {
#ifdef GLFW_MAXIMIZED #ifdef GLFW_MAXIMIZED
glfwWindowHint(GLFW_MAXIMIZED, flags >= Configuration::WindowFlag::Maximized); glfwWindowHint(GLFW_MAXIMIZED, flags >= Configuration::WindowFlag::Maximized);
#endif #endif
glfwWindowHint(GLFW_ICONIFIED, flags >= Configuration::WindowFlag::Minimized);
glfwWindowHint(GLFW_FLOATING, flags >= Configuration::WindowFlag::Floating); glfwWindowHint(GLFW_FLOATING, flags >= Configuration::WindowFlag::Floating);
} }
glfwWindowHint(GLFW_FOCUSED, configuration.windowFlags() >= Configuration::WindowFlag::Focused); 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_OPENGL_DEBUG_CONTEXT, flags >= Configuration::Flag::Debug);
glfwWindowHint(GLFW_STEREO, flags >= Configuration::Flag::Stereo); glfwWindowHint(GLFW_STEREO, flags >= Configuration::Flag::Stereo);
/* Cursor flags */
glfwWindowHint(GLFW_CURSOR, Int(configuration.cursorMode()));
/* Set context version, if requested */ /* Set context version, if requested */
if(configuration.version() != Version::None) { if(configuration.version() != Version::None) {
Int major, minor; Int major, minor;
@ -130,6 +126,12 @@ bool GlfwApplication::tryCreateContext(const Configuration& configuration) {
return false; 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 */ /* Set callbacks */
glfwSetFramebufferSizeCallback(_window, staticViewportEvent); glfwSetFramebufferSizeCallback(_window, staticViewportEvent);
glfwSetKeyCallback(_window, staticKeyEvent); glfwSetKeyCallback(_window, staticKeyEvent);

Loading…
Cancel
Save