reimplemented the client-area/window-area conversion code. It should now
[freeglut] / progs / demos / Resizer / Resizer.cpp
index 76d55f7..bd19ffe 100644 (file)
@@ -220,13 +220,19 @@ void Redisplay(void)
 \r
 int main(int argc, char* argv[])\r
 {\r
+    int border, caption;\r
     glutInit( &argc, argv );\r
     glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE /*| GLUT_BORDERLESS*/); // do try as well with GLUT_BORDERLESS and GLUT_CAPTIONLESS\r
     glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE,GLUT_ACTION_GLUTMAINLOOP_RETURNS);\r
-\r
-    /* The window position you request is the outer top-left of the window,\r
-     * the client area is at a different position if the window has borders\r
-     * and/or a title bar.\r
+    \r
+    /* Get border and caption size of default window style */\r
+    border  = glutGet(GLUT_WINDOW_BORDER_WIDTH);\r
+    caption = glutGet(GLUT_WINDOW_HEADER_HEIGHT);\r
+    printf("default window style border: %dpx, caption: %dpx\n",border,caption);\r
+\r
+    /* NB: The window position you request is the outer top-left of the\r
+     * window, the client area is at a different position if the window has\r
+     * borders and/or a title bar.\r
      */\r
     glutInitWindowPosition(150,250);\r
     glutInitWindowSize(200,200);\r