Unified nomenclature for cursor positions.

This commit is contained in:
Camilla Berglund
2012-06-22 13:53:02 +02:00
parent e6896a499c
commit cef9dea1d2
14 changed files with 102 additions and 101 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -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