mirror of
https://github.com/raysan5/raylib.git
synced 2026-06-04 21:06:42 +08:00
Fix core_input_gamepad_info example so all buttons are displayed within the window (#4241)
Some checks failed
Android / build (arm64) (push) Has been cancelled
Android / build (x86_64) (push) Has been cancelled
CMakeBuilds / Windows Build (push) Has been cancelled
CMakeBuilds / Linux Build (push) Has been cancelled
Linux / build (i386, i386, /user/bin, 32) (push) Has been cancelled
Linux / build (x86_64, amd64, /user/bin, 64) (push) Has been cancelled
Linux Examples / build (push) Has been cancelled
macOS / build (push) Has been cancelled
WebAssembly / build (push) Has been cancelled
Windows / build (i686, pe-i386, 32, mingw-w64) (push) Has been cancelled
Windows / build (x64, x64, 64, msvc16) (push) Has been cancelled
Windows / build (x86, Win32, 32, msvc16) (push) Has been cancelled
Windows / build (x86_64, pe-x86-64, 64, mingw-w64) (push) Has been cancelled
Windows Examples / build (push) Has been cancelled
Some checks failed
Android / build (arm64) (push) Has been cancelled
Android / build (x86_64) (push) Has been cancelled
CMakeBuilds / Windows Build (push) Has been cancelled
CMakeBuilds / Linux Build (push) Has been cancelled
Linux / build (i386, i386, /user/bin, 32) (push) Has been cancelled
Linux / build (x86_64, amd64, /user/bin, 64) (push) Has been cancelled
Linux Examples / build (push) Has been cancelled
macOS / build (push) Has been cancelled
WebAssembly / build (push) Has been cancelled
Windows / build (i686, pe-i386, 32, mingw-w64) (push) Has been cancelled
Windows / build (x64, x64, 64, msvc16) (push) Has been cancelled
Windows / build (x86, Win32, 32, msvc16) (push) Has been cancelled
Windows / build (x86_64, pe-x86-64, 64, mingw-w64) (push) Has been cancelled
Windows Examples / build (push) Has been cancelled
This commit is contained in:
parent
13491a485a
commit
46cb6af437
@ -47,25 +47,25 @@ int main(void)
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
for (int i = 0, y = 10; i < 4; i++) // MAX_GAMEPADS = 4
|
||||
for (int i = 0, y = 5; i < 4; i++) // MAX_GAMEPADS = 4
|
||||
{
|
||||
if (IsGamepadAvailable(i))
|
||||
{
|
||||
DrawText(TextFormat("Gamepad name: %s", GetGamepadName(i)), 10, y, 20, BLACK);
|
||||
y += 30;
|
||||
DrawText(TextFormat("\tAxis count: %d", GetGamepadAxisCount(i)), 10, y, 20, BLACK);
|
||||
y += 30;
|
||||
DrawText(TextFormat("Gamepad name: %s", GetGamepadName(i)), 10, y, 10, BLACK);
|
||||
y += 11;
|
||||
DrawText(TextFormat("\tAxis count: %d", GetGamepadAxisCount(i)), 10, y, 10, BLACK);
|
||||
y += 11;
|
||||
|
||||
for (int axis = 0; axis < GetGamepadAxisCount(i); axis++)
|
||||
{
|
||||
DrawText(TextFormat("\tAxis %d = %f", axis, GetGamepadAxisMovement(i, axis)), 10, y, 20, BLACK);
|
||||
y += 30;
|
||||
DrawText(TextFormat("\tAxis %d = %f", axis, GetGamepadAxisMovement(i, axis)), 10, y, 10, BLACK);
|
||||
y += 11;
|
||||
}
|
||||
|
||||
for (int button = 0; button < 32; button++)
|
||||
{
|
||||
DrawText(TextFormat("\tButton %d = %d", button, IsGamepadButtonDown(i, button)), 10, y, 20, BLACK);
|
||||
y += 30;
|
||||
DrawText(TextFormat("\tButton %d = %d", button, IsGamepadButtonDown(i, button)), 10, y, 10, BLACK);
|
||||
y += 11;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -80,4 +80,4 @@ int main(void)
|
||||
//--------------------------------------------------------------------------------------
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user