Added GLFW_AUTO_ICONIFY.

By default, full screen windows that lose focus will be iconified and
the video mode will be restored.  This makes it impossible to create
applications spanning multiple monitors.  The GLFW_AUTO_ICONIFY window
hint will allow users to disable this behavior.

Fixes #143.
This commit is contained in:
Camilla Berglund
2014-04-08 15:32:34 +02:00
parent 4fb5da75dc
commit 25e7ff1196
7 changed files with 43 additions and 18 deletions
+13 -7
View File
@@ -173,6 +173,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
wndconfig.resizable = _glfw.hints.resizable ? GL_TRUE : GL_FALSE;
wndconfig.visible = _glfw.hints.visible ? GL_TRUE : GL_FALSE;
wndconfig.decorated = _glfw.hints.decorated ? GL_TRUE : GL_FALSE;
wndconfig.autoIconify = _glfw.hints.autoIconify ? GL_TRUE : GL_FALSE;
wndconfig.monitor = (_GLFWmonitor*) monitor;
// Set up desired context config
@@ -207,10 +208,11 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
window->videoMode.refreshRate = Max(_glfw.hints.refreshRate, 0);
}
window->monitor = wndconfig.monitor;
window->resizable = wndconfig.resizable;
window->decorated = wndconfig.decorated;
window->cursorMode = GLFW_CURSOR_NORMAL;
window->monitor = wndconfig.monitor;
window->resizable = wndconfig.resizable;
window->decorated = wndconfig.decorated;
window->autoIconify = wndconfig.autoIconify;
window->cursorMode = GLFW_CURSOR_NORMAL;
// Save the currently current context so it can be restored later
previous = _glfwPlatformGetCurrentContext();
@@ -267,9 +269,10 @@ void glfwDefaultWindowHints(void)
_glfw.hints.minor = 0;
// The default is a visible, resizable window with decorations
_glfw.hints.resizable = GL_TRUE;
_glfw.hints.visible = GL_TRUE;
_glfw.hints.decorated = GL_TRUE;
_glfw.hints.resizable = GL_TRUE;
_glfw.hints.visible = GL_TRUE;
_glfw.hints.decorated = GL_TRUE;
_glfw.hints.autoIconify = GL_TRUE;
// The default is 24 bits of color, 24 bits of depth and 8 bits of stencil
_glfw.hints.redBits = 8;
@@ -331,6 +334,9 @@ GLFWAPI void glfwWindowHint(int target, int hint)
case GLFW_DECORATED:
_glfw.hints.decorated = hint;
break;
case GLFW_AUTO_ICONIFY:
_glfw.hints.autoIconify = hint;
break;
case GLFW_VISIBLE:
_glfw.hints.visible = hint;
break;