Add SDL_GetPointDisplayIndex and SDL_GetRectDisplayIndex and re-implement SDL_GetWindowDisplayIndex in terms of SDL_GetRectDisplayIndex
- This allows looking up the display index for an arbitrary location rather than requiring an active window to do so. - This change also reimplements the fallback display lookup that found the display with center closest to the window's center to instead find the display rect edge closest to the window center (this was done in the almost identical display lookup used in SDL_windowsmodes.c, which now uses `SDL_GetPointDisplayIndex`). In practice this should almost never be hit as it requires the window's center to not be enclosed by any display rect.
This commit is contained in:
1 parent
20f9a1b8a4
commit
98bac00dcc
7 files changed
+116
-94
No files matched your search
@@ -854,3 +854,5 @@
|
||||
++'_SDL_GetOriginalMemoryFunctions'.'SDL2.dll'.'SDL_GetOriginalMemoryFunctions'
|
||||
++'_SDL_ResetKeyboard'.'SDL2.dll'.'SDL_ResetKeyboard'
|
||||
++'_SDL_GetDefaultAudioInfo'.'SDL2.dll'.'SDL_GetDefaultAudioInfo'
|
||||
++'_SDL_GetPointDisplayIndex'.'SDL2.dll'.'SDL_GetPointDisplayIndex'
|
||||
++'_SDL_GetRectDisplayIndex'.'SDL2.dll'.'SDL_GetRectDisplayIndex'
|
||||
@@ -880,3 +880,5 @@
|
||||
#define SDL_GetOriginalMemoryFunctions SDL_GetOriginalMemoryFunctions_REAL
|
||||
#define SDL_ResetKeyboard SDL_ResetKeyboard_REAL
|
||||
#define SDL_GetDefaultAudioInfo SDL_GetDefaultAudioInfo_REAL
|
||||
#define SDL_GetPointDisplayIndex SDL_GetPointDisplayIndex_REAL
|
||||
#define SDL_GetRectDisplayIndex SDL_GetRectDisplayIndex_REAL
|
||||
@@ -963,3 +963,5 @@ SDL_DYNAPI_PROC(int,SDL_GDKRunApp,(SDL_main_func a, void *b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_GetOriginalMemoryFunctions,(SDL_malloc_func *a, SDL_calloc_func *b, SDL_realloc_func *c, SDL_free_func *d),(a,b,c,d),)
|
||||
SDL_DYNAPI_PROC(void,SDL_ResetKeyboard,(void),(),)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetDefaultAudioInfo,(char **a, SDL_AudioSpec *b, int c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetPointDisplayIndex,(const SDL_Point *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetRectDisplayIndex,(const SDL_Rect *a),(a),return)
|
||||
Reference in new issue
Block a user