diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-30 14:01:56 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-30 14:02:02 +0300 |
commit | 65451a18a3f6acfd6d641eb48c2253f1f998b9f8 (patch) | |
tree | 7b1b3c489370349f4f0973d6736b4e7a92992596 | |
parent | a2dc01464497eda1dbc03f474e798c47292dc3ee (diff) |
Windows: Declare as HiDPI aware
-rw-r--r-- | src/main.c | 5 | ||||
-rw-r--r-- | src/win32.c | 4 | ||||
-rw-r--r-- | src/win32.h | 1 |
3 files changed, 10 insertions, 0 deletions
@@ -34,6 +34,10 @@ extern void enableMomentumScroll_MacOS(void); | |||
34 | extern void registerURLHandler_MacOS(void); | 34 | extern void registerURLHandler_MacOS(void); |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | #if defined (iPlatformMsys) | ||
38 | # include "win32.h" | ||
39 | #endif | ||
40 | |||
37 | int main(int argc, char **argv) { | 41 | int main(int argc, char **argv) { |
38 | #if defined (iPlatformApple) | 42 | #if defined (iPlatformApple) |
39 | enableMomentumScroll_MacOS(); | 43 | enableMomentumScroll_MacOS(); |
@@ -41,6 +45,7 @@ int main(int argc, char **argv) { | |||
41 | #endif | 45 | #endif |
42 | #if defined (iPlatformMsys) | 46 | #if defined (iPlatformMsys) |
43 | /* MSYS runtime takes care of WinMain. */ | 47 | /* MSYS runtime takes care of WinMain. */ |
48 | setDPIAware_Win32(); | ||
44 | SDL_SetMainReady(); | 49 | SDL_SetMainReady(); |
45 | #endif | 50 | #endif |
46 | init_Foundation(); | 51 | init_Foundation(); |
diff --git a/src/win32.c b/src/win32.c index 7685fcac..36043b53 100644 --- a/src/win32.c +++ b/src/win32.c | |||
@@ -26,6 +26,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
26 | #define WIN32_LEAN_AND_MEAN | 26 | #define WIN32_LEAN_AND_MEAN |
27 | #include <Windows.h> | 27 | #include <Windows.h> |
28 | 28 | ||
29 | void setDPIAware_Win32(void) { | ||
30 | SetProcessDPIAware(); | ||
31 | } | ||
32 | |||
29 | void useExecutableIconResource_SDLWindow(SDL_Window *win) { | 33 | void useExecutableIconResource_SDLWindow(SDL_Window *win) { |
30 | HINSTANCE handle = GetModuleHandle(NULL); | 34 | HINSTANCE handle = GetModuleHandle(NULL); |
31 | HICON icon = LoadIcon(handle, "IDI_ICON1"); | 35 | HICON icon = LoadIcon(handle, "IDI_ICON1"); |
diff --git a/src/win32.h b/src/win32.h index 3dac677c..33863c8e 100644 --- a/src/win32.h +++ b/src/win32.h | |||
@@ -23,4 +23,5 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
23 | #pragma once | 23 | #pragma once |
24 | #include <SDL_video.h> | 24 | #include <SDL_video.h> |
25 | 25 | ||
26 | void setDPIAware_Win32(void); | ||
26 | void useExecutableIconResource_SDLWindow(SDL_Window *win); | 27 | void useExecutableIconResource_SDLWindow(SDL_Window *win); |