Add glfwGetJoystickHats

This merges the public part of the glfwGetJoystickHats work by
@IntellectualKitty.  The implementation needs replacing due to
refactoring in preparation for gamecontrollerdb support.

Closes #906.
This commit is contained in:
IntellectualKitty
2016-11-25 20:56:24 -07:00
committed by Camilla Löwy
parent 12dcfd08b8
commit 368dec7ac7
3 changed files with 92 additions and 3 deletions
+16
View File
@@ -667,6 +667,22 @@ GLFWAPI const unsigned char* glfwGetJoystickButtons(int jid, int* count)
return _glfw.joysticks[jid].buttons;
}
GLFWAPI const unsigned char* glfwGetJoystickHats(int jid, int* count)
{
assert(count != NULL);
*count = 0;
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
if (jid < 0 || jid > GLFW_JOYSTICK_LAST)
{
_glfwInputError(GLFW_INVALID_ENUM, "Invalid joystick %i", jid);
return NULL;
}
return NULL;
}
GLFWAPI const char* glfwGetJoystickName(int jid)
{
assert(jid >= GLFW_JOYSTICK_1);