Added more input functions to clarify internal API.

This commit is contained in:
Camilla Berglund
2011-10-09 17:10:40 +02:00
parent 792034c42d
commit d0840bdea1
5 changed files with 109 additions and 104 deletions
+69
View File
@@ -182,6 +182,28 @@ void _glfwInputMouseClick(_GLFWwindow* window, int button, int action)
}
//========================================================================
// Register cursor moves
//========================================================================
void _glfwInputCursorMotion(_GLFWwindow* window, int x, int y)
{
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
{
window->mousePosX += x;
window->mousePosY += y;
}
else
{
window->mousePosX = x;
window->mousePosY = y;
}
if (_glfwLibrary.mousePosCallback)
_glfwLibrary.mousePosCallback(window, x, y);
}
//========================================================================
// Register window focus events
//========================================================================
@@ -227,6 +249,53 @@ void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean activated)
}
//========================================================================
// Register window position events
//========================================================================
void _glfwInputWindowPos(_GLFWwindow* window, int x, int y)
{
if (window->positionX == x && window->positionY == y)
return;
window->positionX = x;
window->positionY = y;
}
//========================================================================
// Register window size events
//========================================================================
void _glfwInputWindowSize(_GLFWwindow* window, int width, int height)
{
if (window->width == width && window->height == height)
return;
window->width = width;
window->height = height;
if (_glfwLibrary.windowSizeCallback)
_glfwLibrary.windowSizeCallback(window, width, height);
}
//========================================================================
// Register window size events
//========================================================================
void _glfwInputWindowIconify(_GLFWwindow* window, int iconified)
{
if (window->iconified == iconified)
return;
window->iconified = iconified;
if (_glfwLibrary.windowIconifyCallback)
_glfwLibrary.windowIconifyCallback(window, iconified);
}
//////////////////////////////////////////////////////////////////////////
////// GLFW public API //////
//////////////////////////////////////////////////////////////////////////