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
+3
View File
@@ -97,6 +97,8 @@ static GLFWbool openJoystickDevice(DWORD index)
js->name = strdup(getDeviceDescription(&xic));
js->index = index;
_glfwInputJoystickChange(joy, GLFW_CONNECTED);
return GLFW_TRUE;
}
@@ -120,6 +122,7 @@ static GLFWbool pollJoystickEvents(_GLFWjoystickWin32* js, int flags)
{
free(js->name);
memset(js, 0, sizeof(_GLFWjoystickWin32));
_glfwInputJoystickChange((int) (js - _glfw.win32_js), GLFW_DISCONNECTED);
}
return GLFW_FALSE;