Przeglądaj źródła

Init mouse positions

pull/4665/head
asdqwe 1 tydzień temu
rodzic
commit
0c07eca9dc
1 zmienionych plików z 8 dodań i 0 usunięć
  1. +8
    -0
      src/platforms/rcore_desktop_glfw.c

+ 8
- 0
src/platforms/rcore_desktop_glfw.c Wyświetl plik

@ -1654,6 +1654,14 @@ int InitPlatform(void)
{
if (glfwJoystickPresent(i)) strcpy(CORE.Input.Gamepad.name[i], glfwGetJoystickName(i));
}
// Initialize mouse positions:
const double xpos, ypos;
glfwGetCursorPos(platform.handle, &xpos, &ypos);
CORE.Input.Mouse.previousPosition.x = (float)xpos;
CORE.Input.Mouse.previousPosition.y = (float)ypos;
CORE.Input.Mouse.currentPosition.x = (float)xpos;
CORE.Input.Mouse.currentPosition.y = (float)ypos;
//----------------------------------------------------------------------------
// Initialize timming system

Ładowanie…
Anuluj
Zapisz