mirror of
https://github.com/glfw/glfw.git
synced 2025-10-03 13:20:58 +00:00
Added mode toggling to Boing.
This commit is contained in:
parent
0f7d412890
commit
cdaec8a93f
@ -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)
|
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user