#include <GL/freeglut.h>
#include "freeglut_internal.h"
-#if TARGET_HOST_UNIX_X11
+#if TARGET_HOST_POSIX_X11
#include <X11/cursorfont.h>
#endif
/* -- PRIVATE FUNCTIONS --------------------------------------------------- */
-#if TARGET_HOST_UNIX_X11
+#if TARGET_HOST_POSIX_X11
/*
* A factory method for an empty cursor
*/
*/
void fgSetCursor ( SFG_Window *window, int cursorID )
{
-#if TARGET_HOST_UNIX_X11
+#if TARGET_HOST_POSIX_X11
{
Cursor cursor;
/*
}
}
-#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
+#elif TARGET_HOST_MS_WINDOWS
/*
- * This is a temporary solution only...
+ * Joe Krahn is re-writing the following code.
*/
/* Set the cursor AND change it for this window class. */
+#if !defined(__MINGW64__) && _MSC_VER <= 1200
# define MAP_CURSOR(a,b) \
case a: \
SetCursor( LoadCursor( NULL, b ) ); \
GCL_HCURSOR, \
( LONG )LoadCursor( NULL, b ) ); \
break;
-
/* Nuke the cursor AND change it for this window class. */
# define ZAP_CURSOR(a,b) \
case a: \
SetClassLong( window->Window.Handle, \
GCL_HCURSOR, ( LONG )NULL ); \
break;
+#else
+# define MAP_CURSOR(a,b) \
+ case a: \
+ SetCursor( LoadCursor( NULL, b ) ); \
+ SetClassLongPtr( window->Window.Handle, \
+ GCLP_HCURSOR, \
+ ( LONG )( LONG_PTR )LoadCursor( NULL, b ) ); \
+ break;
+ /* Nuke the cursor AND change it for this window class. */
+# define ZAP_CURSOR(a,b) \
+ case a: \
+ SetCursor( NULL ); \
+ SetClassLongPtr( window->Window.Handle, \
+ GCLP_HCURSOR, ( LONG )( LONG_PTR )NULL ); \
+ break;
+#endif
switch( cursorID )
{
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutWarpPointer" );
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutWarpPointer" );
-#if TARGET_HOST_UNIX_X11
+#if TARGET_HOST_POSIX_X11
XWarpPointer(
fgDisplay.Display,
/* Make the warp visible immediately. */
XFlush( fgDisplay.Display );
-#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
+#elif TARGET_HOST_MS_WINDOWS
{
POINT coords;