mirror of
https://github.com/glfw/glfw.git
synced 2026-02-17 21:12:34 +01:00
Unified nomenclature for cursor positions.
This commit is contained in:
@@ -379,7 +379,7 @@ static void windowRefreshFun(GLFWwindow window)
|
||||
// Mouse position callback function
|
||||
//========================================================================
|
||||
|
||||
static void mousePosFun(GLFWwindow window, int x, int y)
|
||||
static void cursorPosFun(GLFWwindow window, int x, int y)
|
||||
{
|
||||
// Depending on which view was selected, rotate around different axes
|
||||
switch (active_view)
|
||||
@@ -404,7 +404,7 @@ static void mousePosFun(GLFWwindow window, int x, int y)
|
||||
break;
|
||||
}
|
||||
|
||||
// Remember mouse position
|
||||
// Remember cursor position
|
||||
xpos = x;
|
||||
ypos = y;
|
||||
}
|
||||
@@ -472,7 +472,7 @@ int main(void)
|
||||
// Set callback functions
|
||||
glfwSetWindowSizeCallback(windowSizeFun);
|
||||
glfwSetWindowRefreshCallback(windowRefreshFun);
|
||||
glfwSetMousePosCallback(mousePosFun);
|
||||
glfwSetCursorPosCallback(cursorPosFun);
|
||||
glfwSetMouseButtonCallback(mouseButtonFun);
|
||||
|
||||
// Main loop
|
||||
|
||||
@@ -39,7 +39,7 @@ int main(void)
|
||||
do
|
||||
{
|
||||
double t = glfwGetTime();
|
||||
glfwGetMousePos(window, &x, NULL);
|
||||
glfwGetCursorPos(window, &x, NULL);
|
||||
|
||||
// Get window size (may be different than the requested size)
|
||||
glfwGetWindowSize(window, &width, &height);
|
||||
|
||||
@@ -323,10 +323,10 @@ void mouse_button_callback(GLFWwindow window, int button, int action)
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Callback function for mouse motion events
|
||||
// Callback function for cursor motion events
|
||||
//========================================================================
|
||||
|
||||
void mouse_position_callback(GLFWwindow window, int x, int y)
|
||||
void cursor_position_callback(GLFWwindow window, int x, int y)
|
||||
{
|
||||
if (locked)
|
||||
{
|
||||
@@ -403,7 +403,7 @@ int main(int argc, char* argv[])
|
||||
// Window resize handler
|
||||
glfwSetWindowSizeCallback(window_resize_callback);
|
||||
glfwSetMouseButtonCallback(mouse_button_callback);
|
||||
glfwSetMousePosCallback(mouse_position_callback);
|
||||
glfwSetCursorPosCallback(cursor_position_callback);
|
||||
glfwSetScrollCallback(scroll_callback);
|
||||
|
||||
// Initialize OpenGL
|
||||
|
||||
Reference in New Issue
Block a user