diff options
author | David Robillard <d@drobilla.net> | 2014-01-27 02:33:20 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-01-27 02:33:20 +0000 |
commit | 55962a68aada2975d78899371788a97e943b1ce3 (patch) | |
tree | a9e9f347d7780070304ca657d2a807f5091de5d8 | |
parent | f716d1323e5e1bd8478cd19034a5c1d96ffa3bdd (diff) | |
download | pugl-55962a68aada2975d78899371788a97e943b1ce3.tar.gz pugl-55962a68aada2975d78899371788a97e943b1ce3.tar.bz2 pugl-55962a68aada2975d78899371788a97e943b1ce3.zip |
Fix compilation on 64-bit Windows. Maybe.
-rw-r--r-- | pugl/pugl_win.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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); |