implementing mouse move and get screen size, removing warnings

This commit is contained in:
Kbz-8
2024-09-15 08:56:22 +02:00
parent 7243c67c3e
commit 7079e1e42d
14 changed files with 85 additions and 41 deletions

View File

@@ -159,6 +159,20 @@ namespace mlx
return Vec2ui{ extent };
}
void SDLManager::MoveMouseOnWindow(Handle window, int x, int y) const noexcept
{
SDL_WarpMouseInWindow(static_cast<SDL_Window*>(window), x, y);
SDL_PumpEvents();
}
void SDLManager::GetScreenSizeWindowIsOn(Handle window, int* x, int* y) const noexcept
{
SDL_DisplayMode DM;
SDL_GetDesktopDisplayMode(SDL_GetWindowDisplayIndex(static_cast<SDL_Window*>(window)), &DM);
*x = DM.w;
*y = DM.h;
}
std::int32_t SDLManager::GetX() const noexcept
{
int dummy;