From 55962a68aada2975d78899371788a97e943b1ce3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 27 Jan 2014 02:33:20 +0000 Subject: Fix compilation on 64-bit Windows. Maybe. --- pugl/pugl_win.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pugl/pugl_win.cpp b/pugl/pugl_win.cpp index 9b7cbcd..8ed19d8 100644 --- a/pugl/pugl_win.cpp +++ b/pugl/pugl_win.cpp @@ -106,6 +106,12 @@ puglCreate(PuglNativeWindow parent, free(view); return NULL; } + +#ifdef _WIN64 + SetWindowLongPtr(impl->hwnd, GWLP_USERDATA, (LONG_PTR)view); +#else + SetWindowLongPtr(impl->hwnd, GWL_USERDATA, (LONG)view); +#endif SetWindowLongPtr(impl->hwnd, GWL_USERDATA, (LONG)view); @@ -344,7 +350,12 @@ puglProcessEvents(PuglView* view) LRESULT CALLBACK wndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { +#ifdef _WIN64 + PuglView* view = (PuglView*)GetWindowLongPtr(hwnd, GWLP_USERDATA); +#else PuglView* view = (PuglView*)GetWindowLongPtr(hwnd, GWL_USERDATA); +#endif + switch (message) { case WM_CREATE: PostMessage(hwnd, WM_SHOWWINDOW, TRUE, 0); -- cgit v1.2.3