Added API and X11 implementation of cursor enter and leave callbacks.

This commit is contained in:
Hanmac
2012-01-30 22:18:05 +01:00
committed by Camilla Berglund
parent cd1caded8d
commit 0b752b84c3
5 changed files with 92 additions and 1 deletions
+32
View File
@@ -436,3 +436,35 @@ GLFWAPI void glfwSetScrollCallback(GLFWscrollfun cbfun)
_glfwLibrary.scrollCallback = cbfun;
}
//========================================================================
// Set callback function for cursor enter events
//========================================================================
GLFWAPI void glfwSetCursorEnterCallback(GLFWcursorenterfun cbfun)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
_glfwLibrary.cursorEnterCallback = cbfun;
}
//========================================================================
// Set callback function for cursor enter events
//========================================================================
GLFWAPI void glfwSetCursorLeaveCallback(GLFWcursorleavefun cbfun)
{
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
return;
}
_glfwLibrary.cursorLeaveCallback = cbfun;
}