From cdaec8a93fe4ca2f3911e68c392e5214dd272a19 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 29 Oct 2013 14:09:46 +0100 Subject: [PATCH] Added mode toggling to Boing. --- examples/boing.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples/boing.c b/examples/boing.c index 79d2e958f..7337fd3e4 100644 --- a/examples/boing.c +++ b/examples/boing.c @@ -249,6 +249,18 @@ void key_callback( GLFWwindow* window, int key, int scancode, int action, int mo { if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) glfwSetWindowShouldClose(window, GL_TRUE); + + if (key == GLFW_KEY_ENTER && mods == GLFW_MOD_ALT && action == GLFW_PRESS) + { + if (glfwGetWindowMonitor(window)) + glfwSetWindowMonitor(window, NULL, 640, 480); + else + { + GLFWmonitor* monitor = glfwGetPrimaryMonitor(); + const GLFWvidmode* mode = glfwGetVideoMode(monitor); + glfwSetWindowMonitor(window, monitor, mode->width, mode->height); + } + } } /*****************************************************************************