demos: tri: use AdjustWindowRect for window size
authorMike Stroyan <mike@LunarG.com>
Mon, 15 Jun 2015 20:19:19 +0000 (14:19 -0600)
committerMike Stroyan <mike@LunarG.com>
Tue, 16 Jun 2015 21:55:04 +0000 (15:55 -0600)
This makes renderable area size consistent.

demos/tri.c

index 1eca9b6e463910402b1d7588110629c2658a7093..9b9f84c86818258722465eed681dd77614472987 100644 (file)
@@ -1193,6 +1193,8 @@ static void demo_create_window(struct demo *demo)
         exit(1);
     }
     // Create window with the registered class:
+    RECT wr = { 0, 0, demo->width, demo->height };
+    AdjustWindowRect(&wr, WS_OVERLAPPEDWINDOW, FALSE);
     demo->window = CreateWindowEx(0,
                                   demo->name,           // class name
                                   demo->name,           // app name
@@ -1200,8 +1202,8 @@ static void demo_create_window(struct demo *demo)
                                   WS_VISIBLE |
                                   WS_SYSMENU,
                                   100,100,              // x/y coords
-                                  demo->width,          // width
-                                  demo->height,         // height
+                                  wr.right-wr.left,     // width
+                                  wr.bottom-wr.top,     // height
                                   NULL,                 // handle to parent
                                   NULL,                 // handle to menu
                                   demo->connection,     // hInstance