Procházet zdrojové kódy

Update rcore_desktop_glfw.c

pull/5438/head
Ray před 2 dny
rodič
revize
64bd27bd08
1 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. +3
    -3
      src/platforms/rcore_desktop_glfw.c

+ 3
- 3
src/platforms/rcore_desktop_glfw.c Zobrazit soubor

@ -1266,10 +1266,10 @@ void PollInputEvents(void)
// Get current gamepad state // Get current gamepad state
// NOTE: There is no callback available, so we get it manually // NOTE: There is no callback available, so we get it manually
GLFWgamepadstate state = { 0 }; GLFWgamepadstate state = { 0 };
int isGamepadConnected = glfwGetGamepadState(i, &state); // This remapps all gamepads so they have their buttons mapped like an xbox controller
if (o">!isGamepadConnected)
int result = glfwGetGamepadState(i, &state); // This remaps all gamepads so they have their buttons mapped like an xbox controller
if (n">result == GLFW_FALSE) // No joystick is connected, no gamepad mapping or an error occurred
{ {
// setting axes to expected resting value instead of GLFW's 0.0f default when gamepad isnt connected
// Setting axes to expected resting value instead of GLFW 0.0f default when gamepad isn> not connected
state.axes[GAMEPAD_AXIS_LEFT_TRIGGER] = -1.0f; state.axes[GAMEPAD_AXIS_LEFT_TRIGGER] = -1.0f;
state.axes[GAMEPAD_AXIS_RIGHT_TRIGGER] = -1.0f; state.axes[GAMEPAD_AXIS_RIGHT_TRIGGER] = -1.0f;
} }

Načítá se…
Zrušit
Uložit