move Set_mouse_position() to sdlscreen.c / win32screen.c / etc.

This commit is contained in:
Thomas Bernard
2019-02-04 18:20:51 +01:00
parent d5645dec26
commit 206c67e77c
6 changed files with 31 additions and 11 deletions

View File

@@ -609,3 +609,17 @@ void Define_icon(void)
// Do nothing because the icon is set in the window class
// see Init_Win32()
}
void Set_mouse_position(void)
{
POINT pt;
pt.x = Mouse_X * Pixel_width;
pt.y = Mouse_Y * Pixel_height;
if (!ClientToScreen(Win32_hwnd, &pt))
GFX2_Log(GFX2_WARNING, "ClientToScreen(%08x, %p) failed\n", Win32_hwnd, &pt);
else
{
if (!SetCursorPos(pt.x, pt.y))
GFX2_Log(GFX2_WARNING, "SetCursorPos(%ld, %ld) failed\n", pt.x, pt.y);
}
}