X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2FCommon%2Ffreeglut_internal.h;h=38705156529e0eb0726e8282464e64db8f67899f;hb=789db0244bba0fbaf22e553e4ca12f465b7f3ed6;hp=ebd93403c4468ecf8e10bb96207b780284c17492;hpb=0cd6817079c9f545bbff65d6ac86d9fac6b92db9;p=freeglut diff --git a/src/Common/freeglut_internal.h b/src/Common/freeglut_internal.h index ebd9340..3870515 100644 --- a/src/Common/freeglut_internal.h +++ b/src/Common/freeglut_internal.h @@ -33,8 +33,8 @@ #endif /* XXX Update these for each release! */ -#define VERSION_MAJOR 2 -#define VERSION_MINOR 7 +#define VERSION_MAJOR 3 +#define VERSION_MINOR 0 #define VERSION_PATCH 0 /* Freeglut is intended to function under all Unix/X11 and Win32 platforms. */ @@ -755,6 +755,82 @@ struct tagSFG_StrokeFont /* -- JOYSTICK-SPECIFIC STRUCTURES AND TYPES ------------------------------- */ +/* + * Initial defines from "js.h" starting around line 33 with the existing "freeglut_joystick.c" + * interspersed + */ + +#if TARGET_HOST_MACINTOSH +# include +#endif + +#if TARGET_HOST_MAC_OSX +# include +# include +# include +#endif + +#if TARGET_HOST_POSIX_X11 +# ifdef HAVE_SYS_IOCTL_H +# include +# endif +# ifdef HAVE_FCNTL_H +# include +# endif +# ifdef HAVE_ERRNO_H +# include +# include +# endif +# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) +/* XXX The below hack is done until freeglut's autoconf is updated. */ +# define HAVE_USB_JS 1 + +# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +# include +# else +/* + * XXX NetBSD/amd64 systems may find that they have to steal the + * XXX /usr/include/machine/joystick.h from a NetBSD/i386 system. + * XXX I cannot comment whether that works for the interface, but + * XXX it lets you compile...(^& I do not think that we can do away + * XXX with this header. + */ +# include /* For analog joysticks */ +# endif +# define JS_DATA_TYPE joystick +# define JS_RETURN (sizeof(struct JS_DATA_TYPE)) +# endif + +# if defined(__linux__) +# include + +/* check the joystick driver version */ +# if defined(JS_VERSION) && JS_VERSION >= 0x010000 +# define JS_NEW +# endif +# else /* Not BSD or Linux */ +# ifndef JS_RETURN + + /* + * We'll put these values in and that should + * allow the code to at least compile when there is + * no support. The JS open routine should error out + * and shut off all the code downstream anyway and if + * the application doesn't use a joystick we'll be fine. + */ + + struct JS_DATA_TYPE + { + int buttons; + int x; + int y; + }; + +# define JS_RETURN (sizeof(struct JS_DATA_TYPE)) +# endif +# endif +#endif + /* XXX It might be better to poll the operating system for the numbers of buttons and * XXX axes and then dynamically allocate the arrays. */