mirror of
https://github.com/glfw/glfw.git
synced 2026-09-17 14:22:50 +00:00
Transformed glfwEnable/Disable/SetCursorMode into glfwGetInputMode/SetInputMode.
This commit is contained in:
+1
-1
@@ -586,7 +586,7 @@ int main( void )
|
||||
}
|
||||
|
||||
glfwSetWindowSizeCallback( reshape );
|
||||
glfwEnable( window, GLFW_STICKY_KEYS );
|
||||
glfwSetInputMode( window, GLFW_STICKY_KEYS, GL_TRUE );
|
||||
glfwSwapInterval( 1 );
|
||||
glfwSetTime( 0.0 );
|
||||
|
||||
|
||||
+1
-1
@@ -339,7 +339,7 @@ int main(int argc, char *argv[])
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
glfwEnable( window, GLFW_KEY_REPEAT );
|
||||
glfwSetInputMode( window, GLFW_KEY_REPEAT, GL_TRUE );
|
||||
glfwSwapInterval( 1 );
|
||||
|
||||
// Parse command-line options
|
||||
|
||||
@@ -462,10 +462,10 @@ int main(void)
|
||||
glfwSwapInterval(1);
|
||||
|
||||
// Enable sticky keys
|
||||
glfwEnable(window, GLFW_STICKY_KEYS);
|
||||
glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);
|
||||
|
||||
// Enable mouse cursor (only needed for fullscreen mode)
|
||||
glfwSetCursorMode(window, GLFW_CURSOR_NORMAL);
|
||||
glfwSetInputMode(window, GLFW_CURSOR_MODE, GLFW_CURSOR_NORMAL);
|
||||
|
||||
// Set callback functions
|
||||
glfwSetWindowSizeCallback(windowSizeFun);
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ int main(void)
|
||||
}
|
||||
|
||||
// Ensure we can capture the escape key being pressed below
|
||||
glfwEnable(window, GLFW_STICKY_KEYS);
|
||||
glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);
|
||||
|
||||
// Enable vertical sync (on cards that support it)
|
||||
glfwSwapInterval(1);
|
||||
|
||||
+3
-3
@@ -309,13 +309,13 @@ void mouse_button_callback(GLFWwindow window, int button, int action)
|
||||
|
||||
if (action == GLFW_PRESS)
|
||||
{
|
||||
glfwSetCursorMode(window, GLFW_CURSOR_CAPTURED);
|
||||
glfwSetInputMode(window, GLFW_CURSOR_MODE, GLFW_CURSOR_CAPTURED);
|
||||
locked = GL_TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
locked = GL_FALSE;
|
||||
glfwSetCursorMode(window, GLFW_CURSOR_NORMAL);
|
||||
glfwSetInputMode(window, GLFW_CURSOR_MODE, GLFW_CURSOR_NORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
// Keyboard handler
|
||||
glfwSetKeyCallback(key_callback);
|
||||
glfwEnable(window, GLFW_KEY_REPEAT);
|
||||
glfwSetInputMode(window, GLFW_KEY_REPEAT, GL_TRUE);
|
||||
|
||||
// Window resize handler
|
||||
glfwSetWindowSizeCallback(window_resize_callback);
|
||||
|
||||
Reference in New Issue
Block a user