added cursor changing to resizer demo, for testing
authorDiederick Niehorster <dcnieho@gmail.com>
Thu, 4 Apr 2013 11:04:17 +0000 (11:04 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Thu, 4 Apr 2013 11:04:17 +0000 (11:04 +0000)
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

index 163123f..592c673 100644 (file)
@@ -195,6 +195,26 @@ void SampleKeyboard( unsigned char cChar, int nMouseX, int nMouseY )
         }\r
         glutHideWindow();\r
 \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
+\r
     default:\r
         break;\r
     }\r