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
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);

Loading…
Cancel
Save