Removing duplicate cursor code. This and the previous change (in freeglut_main.c) apparently got combined.

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@576 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
fayjf 2005-04-22 15:23:12 +00:00
parent 437bb127b4
commit 401e4369e5

View File

@ -41,7 +41,7 @@
* apart from the windowing system version. * apart from the windowing system version.
*/ */
/* -- INTERNAL FUNCTIONS --------------------------------------------------- */ /* -- PRIVATE FUNCTIONS --------------------------------------------------- */
#if TARGET_HOST_UNIX_X11 #if TARGET_HOST_UNIX_X11
/* /*
@ -104,16 +104,13 @@ static cursorCacheEntry cursorCache[] = {
}; };
#endif #endif
/* -- INTERFACE FUNCTIONS -------------------------------------------------- */ /* -- INTERNAL FUNCTIONS ---------------------------------------------------- */
/* /*
* Set the cursor image to be used for the current window * Set the cursor image to be used for the current window
*/ */
void FGAPIENTRY glutSetCursor( int cursorID ) void fgSetCursor ( SFG_Window *window, int cursorID )
{ {
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetCursor" );
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSetCursor" );
#if TARGET_HOST_UNIX_X11 #if TARGET_HOST_UNIX_X11
{ {
Cursor cursor; Cursor cursor;
@ -154,7 +151,7 @@ void FGAPIENTRY glutSetCursor( int cursorID )
fgError( "Failed to create cursor" ); fgError( "Failed to create cursor" );
} }
XDefineCursor( fgDisplay.Display, XDefineCursor( fgDisplay.Display,
fgStructure.CurrentWindow->Window.Handle, cursor ); window->Window.Handle, cursor );
} }
#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE #elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
@ -163,20 +160,20 @@ void FGAPIENTRY glutSetCursor( int cursorID )
* This is a temporary solution only... * This is a temporary solution only...
*/ */
/* Set the cursor AND change it for this window class. */ /* Set the cursor AND change it for this window class. */
# define MAP_CURSOR(a,b) \ # define MAP_CURSOR(a,b) \
case a: \ case a: \
SetCursor( LoadCursor( NULL, b ) ); \ SetCursor( LoadCursor( NULL, b ) ); \
SetClassLong( fgStructure.CurrentWindow->Window.Handle, \ SetClassLong( window->Window.Handle, \
GCL_HCURSOR, \ GCL_HCURSOR, \
( LONG )LoadCursor( NULL, b ) ); \ ( LONG )LoadCursor( NULL, b ) ); \
break; break;
/* Nuke the cursor AND change it for this window class. */ /* Nuke the cursor AND change it for this window class. */
# define ZAP_CURSOR(a,b) \ # define ZAP_CURSOR(a,b) \
case a: \ case a: \
SetCursor( NULL ); \ SetCursor( NULL ); \
SetClassLong( fgStructure.CurrentWindow->Window.Handle, \ SetClassLong( window->Window.Handle, \
GCL_HCURSOR, ( LONG )NULL ); \ GCL_HCURSOR, ( LONG )NULL ); \
break; break;
switch( cursorID ) switch( cursorID )
@ -211,7 +208,20 @@ void FGAPIENTRY glutSetCursor( int cursorID )
} }
#endif #endif
fgStructure.CurrentWindow->State.Cursor = cursorID; window->State.Cursor = cursorID;
}
/* -- INTERFACE FUNCTIONS -------------------------------------------------- */
/*
* Set the cursor image to be used for the current window
*/
void FGAPIENTRY glutSetCursor( int cursorID )
{
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetCursor" );
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSetCursor" );
fgSetCursor ( fgStructure.CurrentWindow, cursorID );
} }
/* /*