Move GetGamepadAxisCount from rcore

This commit is contained in:
MichaelFiber 2023-09-18 16:17:51 -04:00
parent c89d178e8d
commit 6809f06b55
5 changed files with 31 additions and 12 deletions

View File

@ -1961,18 +1961,6 @@ bool IsGamepadAvailable(int gamepad)
return result;
}
// Get gamepad axis count
int GetGamepadAxisCount(int gamepad)
{
#if defined(PLATFORM_DRM)
int axisCount = 0;
if (CORE.Input.Gamepad.ready[gamepad]) ioctl(CORE.Input.Gamepad.streamId[gamepad], JSIOCGAXES, &axisCount);
CORE.Input.Gamepad.axisCount = axisCount;
#endif
return CORE.Input.Gamepad.axisCount;
}
// Get axis movement vector for a gamepad
float GetGamepadAxisMovement(int gamepad, int axis)
{

View File

@ -1640,3 +1640,10 @@ int GetMonitorPhysicalWidth(int monitor)
{
return 0;
}
// Get gamepad axis count
int GetGamepadAxisCount(int gamepad)
{
return CORE.Input.Gamepad.axisCount;
}

View File

@ -1524,3 +1524,10 @@ int GetMonitorPhysicalWidth(int monitor)
else TRACELOG(LOG_WARNING, "GLFW: Failed to find selected monitor");
return 0;
}
// Get gamepad axis count
int GetGamepadAxisCount(int gamepad)
{
return CORE.Input.Gamepad.axisCount;
}

View File

@ -962,3 +962,13 @@ int GetMonitorPhysicalWidth(int monitor)
{
return 0;
}
// Get gamepad axis count
int GetGamepadAxisCount(int gamepad)
{
int axisCount = 0;
if (CORE.Input.Gamepad.ready[gamepad]) ioctl(CORE.Input.Gamepad.streamId[gamepad], JSIOCGAXES, &axisCount);
CORE.Input.Gamepad.axisCount = axisCount;
return CORE.Input.Gamepad.axisCount;
}

View File

@ -1562,3 +1562,10 @@ int GetMonitorPhysicalWidth(int monitor)
{
return 0;
}
// Get gamepad axis count
int GetGamepadAxisCount(int gamepad)
{
return CORE.Input.Gamepad.axisCount;
}