Switch to ANSI C comments.
[freeglut] / freeglut-1.3 / freeglut_cursor.c
index 900e1c9..9d519c0 100644 (file)
@@ -32,7 +32,7 @@
 #define  G_LOG_DOMAIN  "freeglut-cursor"
 
 #include "../include/GL/freeglut.h"
-#include "../include/GL/freeglut_internal.h"
+#include "freeglut_internal.h"
 
 #if TARGET_HOST_UNIX_X11
     #include <X11/cursorfont.h>
@@ -43,7 +43,6 @@
  *
  *  fgDisplayCursor()   -- this waits for better times
  *  glutSetCursor()     -- both X and Win32 mappings are incomplete
- *  glutWarpPointer()   -- check the Win32 version
  *
  * It would be good to use custom mouse cursor shapes, and introduce
  * an option to display them using glBitmap() and/or texture mapping,
@@ -112,7 +111,14 @@ void FGAPIENTRY glutSetCursor( int cursorID )
        /*
         * This is a temporary solution only...
         */
-#      define MAP_CURSOR(a,b) case a: SetCursor( LoadCursor( NULL, b ) ); break;
+       /* Set the cursor AND change it for this window class. */
+#      define MAP_CURSOR(a,b) case a: SetCursor( LoadCursor( NULL, b ) ); \
+        SetClassLong(fgStructure.Window->Window.Handle,GCL_HCURSOR,(LONG)LoadCursor(NULL,b)); \
+        break;
+       /* Nuke the cursor AND change it for this window class. */
+#      define ZAP_CURSOR(a,b) case a: SetCursor( NULL ); \
+        SetClassLong(fgStructure.Window->Window.Handle,GCL_HCURSOR,(LONG)NULL); \
+        break;
 
        switch( cursorID )
        {
@@ -126,10 +132,11 @@ void FGAPIENTRY glutSetCursor( int cursorID )
                MAP_CURSOR( GLUT_CURSOR_WAIT,            IDC_WAIT      );
                MAP_CURSOR( GLUT_CURSOR_TEXT,        IDC_UPARROW   );
                MAP_CURSOR( GLUT_CURSOR_CROSSHAIR,   IDC_CROSS     );
-               MAP_CURSOR( GLUT_CURSOR_NONE,        IDC_NO                );
+               /* MAP_CURSOR( GLUT_CURSOR_NONE,        IDC_NO             ); */
+               ZAP_CURSOR( GLUT_CURSOR_NONE,        NULL          );
 
                default:
-               MAP_CURSOR( GLUT_CURSOR_UP_DOWN,         IDC_UPARROW   );
+               MAP_CURSOR( GLUT_CURSOR_UP_DOWN,     IDC_ARROW     );
        }
 
 #endif