From 0419dcb7f0e2233947f76f54cbb635ddf9e03bbb Mon Sep 17 00:00:00 2001 From: Diederick Niehorster Date: Thu, 4 Apr 2013 11:04:17 +0000 Subject: [PATCH] added cursor changing to resizer demo, for testing git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1587 7f0cb862-5218-0410-a997-914c9d46530a --- progs/demos/Resizer/Resizer.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/progs/demos/Resizer/Resizer.cpp b/progs/demos/Resizer/Resizer.cpp index 163123f..592c673 100644 --- a/progs/demos/Resizer/Resizer.cpp +++ b/progs/demos/Resizer/Resizer.cpp @@ -195,6 +195,26 @@ void SampleKeyboard( unsigned char cChar, int nMouseX, int nMouseY ) } glutHideWindow(); + + case 'p': + case 'P': + if (nChildWindow!=-1 && cChar=='p') /* Capital P always changes pointer for the main window*/ + { + glutSetWindow(nChildWindow); + if (glutGet(GLUT_WINDOW_CURSOR)==GLUT_CURSOR_TOP_SIDE) + glutSetCursor(GLUT_CURSOR_RIGHT_ARROW); + else + glutSetCursor(GLUT_CURSOR_TOP_SIDE); + } + else + { + glutSetWindow(nWindow); + if (glutGet(GLUT_WINDOW_CURSOR)==GLUT_CURSOR_CYCLE) + glutSetCursor(GLUT_CURSOR_RIGHT_ARROW); + else + glutSetCursor(GLUT_CURSOR_CYCLE); + } + default: break; } -- 1.7.10.4