]> git.cworth.org Git - apitrace/blobdiff - retrace/d3dretrace_ws.cpp
Resize window on IDirect3DDevice9::Reset.
[apitrace] / retrace / d3dretrace_ws.cpp
index 8626a764597e49507aa9cb6e6eb2ae654720eb71..b8c29e85078bc69d1eb620eb2653fc85231f4ef5 100644 (file)
@@ -104,6 +104,21 @@ createWindow(int width, int height) {
 }
 
 
+void
+resizeWindow(HWND hWnd, int width, int height) {
+    RECT rClient;
+    GetClientRect(hWnd, &rClient);
+    if (width  == rClient.right  - rClient.left &&
+        height == rClient.bottom - rClient.top) {
+        return;
+    }
+
+    RECT rWindow;
+    GetWindowRect(hWnd, &rWindow);
+    width  += (rWindow.right  - rWindow.left) - rClient.right;
+    height += (rWindow.bottom - rWindow.top)  - rClient.bottom;
+    SetWindowPos(hWnd, NULL, rWindow.left, rWindow.top, width, height, SWP_NOMOVE);
+}