]> git.cworth.org Git - apitrace/blobdiff - retrace/glws_wgl.cpp
Don't try to share surfaces.
[apitrace] / retrace / glws_wgl.cpp
index 887a528db38dc21cbb833efb6236036b24c8bbee..c6e4a3fb39b1935e3c29a2a806fdcf007250f211 100644 (file)
@@ -64,6 +64,13 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
     MINMAXINFO *pMMI;
     switch (uMsg) {
+    case WM_KEYDOWN:
+        switch (wParam) {
+        case VK_ESCAPE:
+            PostMessage(hWnd, WM_CLOSE, 0, 0);
+            break;
+        }
+        break;
     case WM_GETMINMAXINFO:
         // Allow to create a window bigger than the desktop
         pMMI = (MINMAXINFO *)lParam;
@@ -72,6 +79,9 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
         pMMI->ptMaxTrackSize.x = 60000;
         pMMI->ptMaxTrackSize.y = 60000;
         break;
+    case WM_CLOSE:
+        exit(0);
+        break;
     default:
         break;
     }
@@ -283,7 +293,7 @@ createDrawable(const Visual *visual, int width, int height)
 }
 
 Context *
-createContext(const Visual *visual, Context *shareContext, Profile profile)
+createContext(const Visual *visual, Context *shareContext, Profile profile, bool debug)
 {
     if (profile != PROFILE_COMPAT) {
         return NULL;
@@ -324,7 +334,17 @@ makeCurrent(Drawable *drawable, Context *context)
 
 bool
 processEvents(void) {
-    // TODO
+    MSG uMsg;
+    while (PeekMessage(&uMsg, NULL, 0, 0, PM_REMOVE)) {
+        if (uMsg.message == WM_QUIT) {
+            return false;
+        }
+
+        if (!TranslateAccelerator(uMsg.hwnd, NULL, &uMsg)) {
+            TranslateMessage(&uMsg);
+            DispatchMessage(&uMsg);
+        }
+    }
     return true;
 }