glutTimerFunc(2000, UnhideTimer, nWindow);\r
}\r
glutHideWindow();\r
+ break;\r
+\r
+ case 'p':\r
+ case 'P':\r
+ if (nChildWindow!=-1 && cChar=='p') /* Capital P always changes pointer for the main window*/\r
+ {\r
+ glutSetWindow(nChildWindow);\r
+ if (glutGet(GLUT_WINDOW_CURSOR)==GLUT_CURSOR_TOP_SIDE)\r
+ glutSetCursor(GLUT_CURSOR_RIGHT_ARROW);\r
+ else\r
+ glutSetCursor(GLUT_CURSOR_TOP_SIDE);\r
+ }\r
+ else\r
+ {\r
+ glutSetWindow(nWindow);\r
+ if (glutGet(GLUT_WINDOW_CURSOR)==GLUT_CURSOR_CYCLE)\r
+ glutSetCursor(GLUT_CURSOR_RIGHT_ARROW);\r
+ else\r
+ glutSetCursor(GLUT_CURSOR_CYCLE);\r
+ }\r
+ break;\r
\r
default:\r
break;\r
void Redisplay(void)\r
{\r
int win = glutGetWindow();\r
+ int viewport[4];\r
\r
if (win==nWindow)\r
{\r
glClear(GL_COLOR_BUFFER_BIT);\r
DrawQuad();\r
\r
+ if (win==nWindow)\r
+ {\r
+ glColor3f(1, 1, 0);\r
+ glGetIntegerv(GL_VIEWPORT, viewport);\r
+ glRasterPos2i(2, -glutBitmapHeight(GLUT_BITMAP_9_BY_15)+3+viewport[3]);\r
+ glutBitmapString(GLUT_BITMAP_9_BY_15, (unsigned char*)"press f/r/m/d/c/i/h/p");\r
+ }\r
+\r
glutSwapBuffers();\r
glutPostWindowRedisplay(win);\r
}\r
width, height,\r
x ,y,\r
x-border,\r
- y-border-caption);\r
+ y-caption);\r
else\r
printf("child window %dx%d, top-left of client at: (%d,%d), relative to parent\n",\r
width, height,\r