X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=freeglut-1.3%2Ffreeglut_cursor.c;h=9d519c04141f4869b5dd12b8921c964c8fb8d905;hb=c85c8a583d485d8eca05ab255963cbc4ecb02bc6;hp=900e1c9ad44ce7f6ddc196db3bea82b1cdbd87a7;hpb=c90e3f21e02020232054f78029ef9071c7359cfb;p=freeglut diff --git a/freeglut-1.3/freeglut_cursor.c b/freeglut-1.3/freeglut_cursor.c index 900e1c9..9d519c0 100644 --- a/freeglut-1.3/freeglut_cursor.c +++ b/freeglut-1.3/freeglut_cursor.c @@ -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 @@ -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