diff --git a/src/native/win32/org_lwjgl_Display.cpp b/src/native/win32/org_lwjgl_Display.cpp index 225f918b..407a0866 100644 --- a/src/native/win32/org_lwjgl_Display.cpp +++ b/src/native/win32/org_lwjgl_Display.cpp @@ -49,7 +49,7 @@ #define WINDOWCLASSNAME "LWJGLWINDOW" -extern void handleMessages(); +void handleMessages(); extern HINSTANCE dll_handle; // Initialise static variables @@ -181,6 +181,37 @@ LRESULT CALLBACK WindowProc(HWND hWnd, return DefWindowProc(hWnd, msg, wParam, lParam); } +/* + * Handle windowing messages sent by the operating system + */ +void handleMessages() +{ + /* + * Now's our chance to deal with Windows messages that are + * otherwise just piling up and causing everything not to + * work properly + */ + MSG msg; + while (PeekMessage( + &msg, // message information + hwnd, // handle to window + 0, // first message + 0, // last message + PM_NOREMOVE // removal options + )) { + + if (GetMessage (&msg, NULL, 0, 0) <= 0) { +#ifdef _DEBUG + printf("We should quit here...\n"); +#endif + return; + } + TranslateMessage(&msg); + DispatchMessage(&msg); + }; +} + + /* * Sets the fullscreen display mode. * Returns 1 for success and -1 for failure. diff --git a/src/native/win32/org_lwjgl_opengl_BaseGL.cpp b/src/native/win32/org_lwjgl_opengl_BaseGL.cpp index 52fd50c1..660b2a17 100644 --- a/src/native/win32/org_lwjgl_opengl_BaseGL.cpp +++ b/src/native/win32/org_lwjgl_opengl_BaseGL.cpp @@ -46,39 +46,7 @@ HGLRC hglrc = NULL; // OpenGL rendering context extern HDC hdc; extern HWND hwnd; - - - -/* - * Handle windowing messages sent by the operating system - */ -void handleMessages() -{ - /* - * Now's our chance to deal with Windows messages that are - * otherwise just piling up and causing everything not to - * work properly - */ - MSG msg; - while (PeekMessage( - &msg, // message information - hwnd, // handle to window - 0, // first message - 0, // last message - PM_NOREMOVE // removal options - )) { - - if (GetMessage (&msg, NULL, 0, 0) <= 0) { -#ifdef _DEBUG - printf("We should quit here...\n"); -#endif - return; - } - TranslateMessage(&msg); - DispatchMessage(&msg); - }; -} - +extern void handleMessages(); /* * Class: org_lwjgl_opengl_BaseGL