[client,sdl] wrap mouse cursor move in SdlContext

This commit is contained in:
akallabeth
2026-01-25 12:16:16 +01:00
parent 2e7639d903
commit c6b104cce0
3 changed files with 17 additions and 12 deletions

View File

@@ -840,6 +840,18 @@ wLog* SdlContext::getWLog()
return _log;
}
bool SdlContext::moveMouseTo(const SDL_FPoint& pos)
{
auto window = SDL_GetMouseFocus();
if (!window)
return true;
const auto id = SDL_GetWindowID(window);
const auto spos = pixelToScreen(id, pos);
SDL_WarpMouseInWindow(window, spos.x, spos.y);
return true;
}
bool SdlContext::handleEvent(const SDL_WindowEvent* ev)
{