aboutsummaryrefslogtreecommitdiffstats
path: root/pugl
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-02-03 02:17:35 +0000
committerDavid Robillard <d@drobilla.net>2013-02-03 02:17:35 +0000
commitd5bfc40d6dd1834d28db9e0739a8286878e3d77a (patch)
treeec7d5f6eac106bef873ceba3372d31a2e5920191 /pugl
parentaa01d329754134899e6e729d6948a72e0ef881c4 (diff)
downloadpugl-d5bfc40d6dd1834d28db9e0739a8286878e3d77a.tar.gz
pugl-d5bfc40d6dd1834d28db9e0739a8286878e3d77a.tar.bz2
pugl-d5bfc40d6dd1834d28db9e0739a8286878e3d77a.zip
Fix compilation and event handling on Windows.
Diffstat (limited to 'pugl')
-rw-r--r--pugl/pugl_win.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/pugl/pugl_win.cpp b/pugl/pugl_win.cpp
index 14e8070..ff32cf2 100644
--- a/pugl/pugl_win.cpp
+++ b/pugl/pugl_win.cpp
@@ -70,7 +70,7 @@ puglCreate(PuglNativeWindow parent,
// Should class be a parameter? Does this make sense on other platforms?
static int wc_count = 0;
char classNameBuf[256];
- snprintf(classNameBuf, sizeof(classNameBuf), "%s_%d\n", title, wc_count++);
+ _snprintf(classNameBuf, sizeof(classNameBuf), "%s_%d\n", title, wc_count++);
impl->wc.style = CS_OWNDC;
impl->wc.lpfnWndProc = wndProc;
@@ -322,6 +322,12 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam)
PuglStatus
puglProcessEvents(PuglView* view)
{
+ MSG msg;
+ while (PeekMessage(&msg, view->impl->hwnd, 0, 0, PM_REMOVE)) {
+ handleMessage(view, msg.message, msg.wParam, msg.lParam);
+ }
+
+
if (view->redisplay) {
InvalidateRect(view->impl->hwnd, NULL, FALSE);
}