From d5bfc40d6dd1834d28db9e0739a8286878e3d77a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 3 Feb 2013 02:17:35 +0000 Subject: Fix compilation and event handling on Windows. --- pugl/pugl_win.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'pugl/pugl_win.cpp') 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); } -- cgit v1.2.1