SDL/src
Sam Lantinga 7c60bec493 Fixed bug 4018 - Implement SDL_GetWindowBordersSize() under Windows/Win32/WinAPI
Ismael Ferreras Morezuelas (Swyter)

As a new year gift I have implemented the Windows version of SDL_GetWindowBordersSize(). I needed it for auto-selecting a cozy window size for the game I'm currently working on and noticed that it only worked under X11, so I thought it could be a good excuse to contribute back more stuff. The Mercurial patch is attached as a .diff file. Let me know what you think.

Happy 2018 to all the SDL2 devs and users!

--

PS: Keep in mind that Windows 10 includes the 8px invisible grip borders as part of the frame. There's a way of detecting if Aero/DWM is being used and ask only for the visible rect, but I believe that GetWindowRect() is doing that for a reason and working as intended, so I haven't changed it. (See [2])


References:
[1]: http://www.firststeps.ru/mfc/winapi/r.php?72
[2]: https://stackoverflow.com/a/34143777/674685
[3]: https://stackoverflow.com/a/431548/674685
[4]: https://wiki.libsdl.org/SDL_GetWindowBordersSize
2018-01-03 10:58:58 -08:00
..
atomic Updated copyright for 2018 2018-01-03 10:03:25 -08:00
audio Updated copyright for 2018 2018-01-03 10:03:25 -08:00
core Updated copyright for 2018 2018-01-03 10:03:25 -08:00
cpuinfo Updated copyright for 2018 2018-01-03 10:03:25 -08:00
dynapi Updated copyright for 2018 2018-01-03 10:03:25 -08:00
events Updated copyright for 2018 2018-01-03 10:03:25 -08:00
file Updated copyright for 2018 2018-01-03 10:03:25 -08:00
filesystem Updated copyright for 2018 2018-01-03 10:03:25 -08:00
haptic Updated copyright for 2018 2018-01-03 10:03:25 -08:00
joystick Updated copyright for 2018 2018-01-03 10:03:25 -08:00
libm Updated copyright for 2018 2018-01-03 10:03:25 -08:00
loadso Updated copyright for 2018 2018-01-03 10:03:25 -08:00
main Updated copyright for 2018 2018-01-03 10:03:25 -08:00
power Updated copyright for 2018 2018-01-03 10:03:25 -08:00
render Updated copyright for 2018 2018-01-03 10:03:25 -08:00
stdlib Updated copyright for 2018 2018-01-03 10:03:25 -08:00
test Updated copyright for 2018 2018-01-03 10:03:25 -08:00
thread Updated copyright for 2018 2018-01-03 10:03:25 -08:00
timer Updated copyright for 2018 2018-01-03 10:03:25 -08:00
video Fixed bug 4018 - Implement SDL_GetWindowBordersSize() under Windows/Win32/WinAPI 2018-01-03 10:58:58 -08:00
SDL_assert_c.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_assert.c Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_dataqueue.c Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_dataqueue.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_error_c.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_error.c Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_hints.c Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_internal.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_log.c Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL.c Updated copyright for 2018 2018-01-03 10:03:25 -08:00