Mouse coordinates are floating point

You can get sub-pixel mouse coordinates and motion depending on the platform and display scaling.

Fixes https://github.com/libsdl-org/SDL/issues/2999
This commit is contained in:
Sam Lantinga 2022-12-29 19:31:12 -08:00
parent 8c3239dee5
commit cefbeb582f
52 changed files with 564 additions and 654 deletions

View file

@ -204,11 +204,6 @@ static int Emscripten_ShowCursor(SDL_Cursor *cursor)
return 0;
}
static void Emscripten_WarpMouse(SDL_Window *window, int x, int y)
{
SDL_Unsupported();
}
static int Emscripten_SetRelativeMouseMode(SDL_bool enabled)
{
SDL_Window *window;
@ -241,7 +236,6 @@ void Emscripten_InitMouse()
mouse->CreateCursor = Emscripten_CreateCursor;
mouse->ShowCursor = Emscripten_ShowCursor;
mouse->FreeCursor = Emscripten_FreeCursor;
mouse->WarpMouse = Emscripten_WarpMouse;
mouse->CreateSystemCursor = Emscripten_CreateSystemCursor;
mouse->SetRelativeMouseMode = Emscripten_SetRelativeMouseMode;