X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=progs%2Fdemos%2FResizer%2FResizer.cpp;h=60d76fe136086b424b29bbc82be3a4b082ec3da6;hb=a0fa770eec20874164678fd2a9a119ca949c924e;hp=76d55f77320adb3fdaccb337c849e7873aba501f;hpb=89dd359a930dae8ea53261279c57aae9387642ef;p=freeglut diff --git a/progs/demos/Resizer/Resizer.cpp b/progs/demos/Resizer/Resizer.cpp index 76d55f7..60d76fe 100644 --- a/progs/demos/Resizer/Resizer.cpp +++ b/progs/demos/Resizer/Resizer.cpp @@ -185,7 +185,10 @@ void Redisplay(void) * when the window is on a monitor to the left of the primary monitor * or simply when maximized--try pressing the maximize button). * the returned size is the size of the client area + * Note that the top-left of a child window is relative to the + * top-left of the client area of the parent. */ + /* printf("window border: %dpx, caption: %dpx\n",border,caption); */ if (win==nWindow) printf("main window %dx%d, top-left of client at: (%d,%d), of window at: (%d,%d)\n", nWidth, nHeight, @@ -220,13 +223,19 @@ void Redisplay(void) int main(int argc, char* argv[]) { + int border, caption; glutInit( &argc, argv ); glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE /*| GLUT_BORDERLESS*/); // do try as well with GLUT_BORDERLESS and GLUT_CAPTIONLESS glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE,GLUT_ACTION_GLUTMAINLOOP_RETURNS); - - /* The window position you request is the outer top-left of the window, - * the client area is at a different position if the window has borders - * and/or a title bar. + + /* Get border and caption size of default window style */ + border = glutGet(GLUT_WINDOW_BORDER_WIDTH); + caption = glutGet(GLUT_WINDOW_HEADER_HEIGHT); + printf("default window style border: %dpx, caption: %dpx\n",border,caption); + + /* NB: The window position you request is the outer top-left of the + * window, the client area is at a different position if the window has + * borders and/or a title bar. */ glutInitWindowPosition(150,250); glutInitWindowSize(200,200);