Add glfwSetJoystickCallback

This commit is contained in:
Camilla Berglund
2015-12-13 17:38:50 +01:00
parent bdd17c337f
commit 8a7fa306ce
12 changed files with 223 additions and 104 deletions
+13
View File
@@ -220,6 +220,12 @@ void _glfwInputDrop(_GLFWwindow* window, int count, const char** paths)
window->callbacks.drop((GLFWwindow*) window, count, paths);
}
void _glfwInputJoystickChange(int joy, int event)
{
if (_glfw.callbacks.joystick)
_glfw.callbacks.joystick(joy, event);
}
//////////////////////////////////////////////////////////////////////////
////// GLFW internal API //////
@@ -621,6 +627,13 @@ GLFWAPI const char* glfwGetJoystickName(int joy)
return _glfwPlatformGetJoystickName(joy);
}
GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun)
{
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
_GLFW_SWAP_POINTERS(_glfw.callbacks.joystick, cbfun);
return cbfun;
}
GLFWAPI void glfwSetClipboardString(GLFWwindow* handle, const char* string)
{
_GLFWwindow* window = (_GLFWwindow*) handle;