Update rcore_desktop_glfw.c
This commit is contained in:
parent
89b4fbd298
commit
8eb613e50a
1 changed files with 5 additions and 5 deletions
|
|
@ -1325,7 +1325,7 @@ void PollInputEvents(void)
|
||||||
// Register previous gamepad states
|
// Register previous gamepad states
|
||||||
for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) CORE.Input.Gamepad.previousButtonState[i][k] = CORE.Input.Gamepad.currentButtonState[i][k];
|
for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) CORE.Input.Gamepad.previousButtonState[i][k] = CORE.Input.Gamepad.currentButtonState[i][k];
|
||||||
|
|
||||||
// Get current gamepad state
|
// Get current gamepad state using internal GLFW mapping, instead of the immediate joystick API
|
||||||
// NOTE: There is no callback available, getting it manually
|
// NOTE: There is no callback available, getting it manually
|
||||||
GLFWgamepadstate state = { 0 };
|
GLFWgamepadstate state = { 0 };
|
||||||
int result = glfwGetGamepadState(i, &state); // This remaps all gamepads so they have their buttons mapped like an xbox controller
|
int result = glfwGetGamepadState(i, &state); // This remaps all gamepads so they have their buttons mapped like an xbox controller
|
||||||
|
|
@ -1340,7 +1340,7 @@ void PollInputEvents(void)
|
||||||
|
|
||||||
for (int k = 0; (buttons != NULL) && (k < MAX_GAMEPAD_BUTTONS); k++)
|
for (int k = 0; (buttons != NULL) && (k < MAX_GAMEPAD_BUTTONS); k++)
|
||||||
{
|
{
|
||||||
int button = -1; // GamepadButton enum values assigned
|
int button = -1; // GamepadButton enum values assigned
|
||||||
|
|
||||||
switch (k)
|
switch (k)
|
||||||
{
|
{
|
||||||
|
|
@ -1366,7 +1366,7 @@ void PollInputEvents(void)
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (button != -1) // Check for valid button
|
if (button != -1) // Check for valid button
|
||||||
{
|
{
|
||||||
if (buttons[k] == GLFW_PRESS)
|
if (buttons[k] == GLFW_PRESS)
|
||||||
{
|
{
|
||||||
|
|
@ -1408,10 +1408,10 @@ void PollInputEvents(void)
|
||||||
if ((CORE.Window.eventWaiting) ||
|
if ((CORE.Window.eventWaiting) ||
|
||||||
(FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_MINIMIZED) && !FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_ALWAYS_RUN)))
|
(FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_MINIMIZED) && !FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_ALWAYS_RUN)))
|
||||||
{
|
{
|
||||||
glfwWaitEvents(); // Wait for in input events before continue (drawing is paused)
|
glfwWaitEvents(); // Wait for in input events before continue (drawing is paused)
|
||||||
CORE.Time.previous = GetTime();
|
CORE.Time.previous = GetTime();
|
||||||
}
|
}
|
||||||
else glfwPollEvents(); // Poll input events: keyboard/mouse/window events (callbacks) -> Update keys state
|
else glfwPollEvents(); // Poll input events: keyboard/mouse/window events (callbacks) -> Update keys state
|
||||||
|
|
||||||
CORE.Window.shouldClose = glfwWindowShouldClose(platform.handle);
|
CORE.Window.shouldClose = glfwWindowShouldClose(platform.handle);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue