Windows: Make SDL APIs DPI aware

This commit is contained in:
Agent X 2024-04-03 20:11:09 -04:00
parent 817c8a1aff
commit 95d0977df5
2 changed files with 16 additions and 0 deletions

View file

@ -6,6 +6,10 @@
#define FOR_WINDOWS 0 #define FOR_WINDOWS 0
#endif #endif
#if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#endif
#include <SDL/SDL.h> #include <SDL/SDL.h>
#include <stdio.h> #include <stdio.h>
@ -110,6 +114,10 @@ static void gfx_sdl_init(const char *window_title) {
} }
controller_bind_init(); controller_bind_init();
#if defined(_WIN32) || defined(_WIN64)
SetProcessDPIAware();
#endif
} }
static void gfx_sdl_main_loop(void (*run_one_game_iter)(void)) { static void gfx_sdl_main_loop(void (*run_one_game_iter)(void)) {

View file

@ -6,6 +6,10 @@
#define FOR_WINDOWS 0 #define FOR_WINDOWS 0
#endif #endif
#if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#endif
#if FOR_WINDOWS #if FOR_WINDOWS
#define GLEW_STATIC #define GLEW_STATIC
#include <GL/glew.h> #include <GL/glew.h>
@ -139,6 +143,10 @@ static void gfx_sdl_init(const char *window_title) {
} }
controller_bind_init(); controller_bind_init();
#if defined(_WIN32) || defined(_WIN64)
SetProcessDPIAware();
#endif
} }
static void gfx_sdl_main_loop(void (*run_one_game_iter)(void)) { static void gfx_sdl_main_loop(void (*run_one_game_iter)(void)) {