* when the window is on a monitor to the left of the primary monitor\r
* or simply when maximized--try pressing the maximize button).\r
* the returned size is the size of the client area\r
+ * Note that the top-left of a child window is relative to the\r
+ * top-left of the client area of the parent.\r
*/\r
+ /* printf("window border: %dpx, caption: %dpx\n",border,caption); */\r
if (win==nWindow)\r
printf("main window %dx%d, top-left of client at: (%d,%d), of window at: (%d,%d)\n",\r
nWidth, nHeight,\r
\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