aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pugl/pugl_win.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/pugl/pugl_win.c b/pugl/pugl_win.c
index ac1993e..c4c7187 100644
--- a/pugl/pugl_win.c
+++ b/pugl/pugl_win.c
@@ -53,6 +53,8 @@
#define PUGL_RESIZE_TIMER_ID 9461
#define PUGL_URGENT_TIMER_ID 9462
+typedef BOOL (WINAPI *PFN_SetProcessDPIAware)(void);
+
static const TCHAR* DEFAULT_CLASSNAME = "Pugl";
LRESULT CALLBACK
@@ -63,6 +65,16 @@ puglInitInternals(void)
{
PuglInternals* impl = (PuglInternals*)calloc(1, sizeof(PuglInternals));
+ HMODULE user32 = LoadLibrary("user32.dll");
+ if (user32) {
+ PFN_SetProcessDPIAware SetProcessDPIAware =
+ (PFN_SetProcessDPIAware)GetProcAddress(
+ user32, "SetProcessDPIAware");
+ if (SetProcessDPIAware) {
+ SetProcessDPIAware();
+ }
+ }
+
LARGE_INTEGER frequency;
QueryPerformanceFrequency(&frequency);
impl->timerFrequency = (double)frequency.QuadPart;