|
|
|
@ -47,6 +47,12 @@ GLFWAPI int glfwGetJoystickParam(int joy, int param) |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (joy < 0 || joy > GLFW_JOYSTICK_LAST) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_INVALID_ENUM, NULL); |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return _glfwPlatformGetJoystickParam(joy, param); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -65,6 +71,18 @@ GLFWAPI int glfwGetJoystickPos(int joy, float* pos, int numaxes) |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (joy < 0 || joy > GLFW_JOYSTICK_LAST) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_INVALID_ENUM, NULL); |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (pos == NULL || numaxes < 0) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_INVALID_VALUE, NULL); |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Clear positions
|
|
|
|
|
for (i = 0; i < numaxes; i++) |
|
|
|
|
pos[i] = 0.0f; |
|
|
|
@ -89,6 +107,18 @@ GLFWAPI int glfwGetJoystickButtons(int joy, |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (joy < 0 || joy > GLFW_JOYSTICK_LAST) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_INVALID_ENUM, NULL); |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (buttons == NULL || numbuttons < 0) |
|
|
|
|
{ |
|
|
|
|
_glfwSetError(GLFW_INVALID_VALUE, NULL); |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Clear button states
|
|
|
|
|
for (i = 0; i < numbuttons; i++) |
|
|
|
|
buttons[i] = GLFW_RELEASE; |
|
|
|
|