mirror of
https://github.com/glfw/glfw.git
synced 2026-09-19 23:43:15 +00:00
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:
committed by
Camilla Löwy
parent
12dcfd08b8
commit
368dec7ac7
+16
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user