aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/win.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-10-03 19:38:55 +0200
committerDavid Robillard <d@drobilla.net>2020-10-04 12:52:37 +0200
commit0b876c3d4e87b65ea3b3f05ec3274b16600e47fc (patch)
tree09f4cb47953ac769c8b740900ea9b54ac8639a52 /pugl/detail/win.c
parenta36408b7c641e0b9052315aed87ce8e591a6a717 (diff)
downloadpugl-0b876c3d4e87b65ea3b3f05ec3274b16600e47fc.tar.gz
pugl-0b876c3d4e87b65ea3b3f05ec3274b16600e47fc.tar.bz2
pugl-0b876c3d4e87b65ea3b3f05ec3274b16600e47fc.zip
Add refresh rate hint
Diffstat (limited to 'pugl/detail/win.c')
-rw-r--r--pugl/detail/win.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pugl/detail/win.c b/pugl/detail/win.c
index 38eca9d..17346cb 100644
--- a/pugl/detail/win.c
+++ b/pugl/detail/win.c
@@ -183,7 +183,7 @@ puglRealize(PuglView* view)
// Get refresh rate for resize draw timer
DEVMODEA devMode = {0};
EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &devMode);
- view->impl->refreshRate = devMode.dmDisplayFrequency;
+ view->hints[PUGL_REFRESH_RATE] = (int)devMode.dmDisplayFrequency;
// Register window class if necessary
if (!puglRegisterWindowClass(view->world->className)) {
@@ -592,7 +592,7 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam)
view->impl->resizing = true;
SetTimer(view->impl->hwnd,
PUGL_RESIZE_TIMER_ID,
- 1000 / view->impl->refreshRate,
+ 1000 / (UINT)view->hints[PUGL_REFRESH_RATE],
NULL);
break;
case WM_TIMER: