resizer demo: adding a bit more output to console to indicate what is going on upon keypress

This commit is contained in:
Diederick C. Niehorster 2017-06-05 20:33:52 +02:00
parent a40f9e9c4e
commit f04be0c4f2

View File

@ -201,18 +201,30 @@ void SampleKeyboard( unsigned char cChar, int nMouseX, int nMouseY )
if (nChildWindow!=-1 && cChar=='p') /* Capital P always changes pointer for the main window*/ if (nChildWindow!=-1 && cChar=='p') /* Capital P always changes pointer for the main window*/
{ {
glutSetWindow(nChildWindow); glutSetWindow(nChildWindow);
if (glutGet(GLUT_WINDOW_CURSOR)==GLUT_CURSOR_TOP_SIDE) if (glutGet(GLUT_WINDOW_CURSOR)==GLUT_CURSOR_TOP_SIDE)
glutSetCursor(GLUT_CURSOR_RIGHT_ARROW); {
glutSetCursor(GLUT_CURSOR_RIGHT_ARROW);
printf("reverting child window cursor\n");
}
else else
glutSetCursor(GLUT_CURSOR_TOP_SIDE); {
glutSetCursor(GLUT_CURSOR_TOP_SIDE);
printf("changing child window cursor\n");
}
} }
else else
{ {
glutSetWindow(nWindow); glutSetWindow(nWindow);
if (glutGet(GLUT_WINDOW_CURSOR)==GLUT_CURSOR_CYCLE) if (glutGet(GLUT_WINDOW_CURSOR)==GLUT_CURSOR_CYCLE)
glutSetCursor(GLUT_CURSOR_RIGHT_ARROW); {
glutSetCursor(GLUT_CURSOR_RIGHT_ARROW);
printf("reverting main window cursor\n");
}
else else
glutSetCursor(GLUT_CURSOR_CYCLE); {
glutSetCursor(GLUT_CURSOR_CYCLE);
printf("changing main window cursor\n");
}
} }
break; break;