瀏覽代碼

Implement IsCursorOnScreen for PLATFORM_DESKTOP_SDL (#3862)

I did some testing and this seems to work okay, but it *is* different to
GLFW. GLFW seems to lose "IsCursorOnScreen" for one frame upon pressing
alt+tab over the window, without a different window covering it. SDL
seems to have a more reasonable behavior for this case. Either way it's
an edge case and I don't know the exact way to fix, likely requires
internal GLFW changes.
pull/3864/head
Peter0x44 1 年之前
committed by GitHub
父節點
當前提交
f072497551
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: B5690EEEBB952194
共有 1 個檔案被更改,包括 7 行新增1 行删除
  1. +7
    -1
      src/platforms/rcore_desktop_sdl.c

+ 7
- 1
src/platforms/rcore_desktop_sdl.c 查看文件

@ -1108,11 +1108,17 @@ void PollInputEvents(void)
CORE.Window.currentFbo.height = height;
CORE.Window.resizedLastFrame = true;
} break;
case SDL_WINDOWEVENT_ENTER:
{
CORE.Input.Mouse.cursorOnScreen = true;
} break;
case SDL_WINDOWEVENT_LEAVE:
{
CORE.Input.Mouse.cursorOnScreen = false;
} break;
case SDL_WINDOWEVENT_HIDDEN:
case SDL_WINDOWEVENT_MINIMIZED:
case SDL_WINDOWEVENT_FOCUS_LOST:
case SDL_WINDOWEVENT_ENTER:
case SDL_WINDOWEVENT_SHOWN:
case SDL_WINDOWEVENT_FOCUS_GAINED:
case SDL_WINDOWEVENT_MAXIMIZED:

Loading…
取消
儲存