testwm2: Fix video modes menu hit detection when highdpi or logical size used (#4936)
* SDLTest_CommonDrawWindowInfo: log SDL_RenderGetScale, SDL_RenderGetLogicalSize * testwm2: fix video modes menu hit detection in High DPI cases - also when logical size is specified, e.g. `--logical 640x480 --resizable --allow-highdpi` * add function to determine logical coordinates of renderer point when given window point * change since to the targeted milestone * fix typo * rename for consistency * Change logical coordinate type to float, since we can render with floating point precision. * add function to convert logical to window coordinates * testwm2: use new SDL_RenderWindowToLogical * SDL_render.c: alternate SDL_RenderWindowToLogical/SDL_RenderLogicalToWindow Co-authored-by: John Blat <johnblat64@protonmail.com> Co-authored-by: John Blat <47202511+johnblat64@users.noreply.github.com>
This commit is contained in:
parent
27ce914463
commit
0d98793693
6 changed files with 103 additions and 2 deletions
|
@ -844,3 +844,5 @@
|
|||
#define SDL_hid_get_indexed_string SDL_hid_get_indexed_string_REAL
|
||||
#define SDL_SetWindowMouseRect SDL_SetWindowMouseRect_REAL
|
||||
#define SDL_GetWindowMouseRect SDL_GetWindowMouseRect_REAL
|
||||
#define SDL_RenderWindowToLogical SDL_RenderWindowToLogical_REAL
|
||||
#define SDL_RenderLogicalToWindow SDL_RenderLogicalToWindow_REAL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue