summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c732b60)
Thierry).
* Renamed some of the old PLIB functions to have glut* prefixes.
(I guess that there is some thought about exporting them to the
API.)
* Changes from Thierry for FreeBSD support, and/or results of testing?
* I re-merged an XXX comment re. NetBSD/amd64 and propogated a
comment on a duplicated #define for FreeBSD. We need the GNU
autoconfig stuff to be updated by someone who groks it, now.
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@460
7f0cb862-5218-0410-a997-
914c9d46530a
# define HAVE_USB_JS 1
# include <sys/ioctl.h>
# define HAVE_USB_JS 1
# include <sys/ioctl.h>
-# include <machine/joystick.h> /* For analog joysticks */
-
-# if __FreeBSD_version >= 500000
+# if defined(__FreeBSD__) && __FreeBSD_version >= 500000
# include <sys/joystick.h>
# else
/*
# include <sys/joystick.h>
# else
/*
* XXX it lets you compile...(^& I do not think that we can do away
* XXX with this header.
*/
* XXX it lets you compile...(^& I do not think that we can do away
* XXX with this header.
*/
-# include <machine/joystick.h>
+# include <machine/joystick.h> /* For analog joysticks */
# endif
# define JS_DATA_TYPE joystick
# define JS_RETURN (sizeof(struct JS_DATA_TYPE))
# endif
# define JS_DATA_TYPE joystick
# define JS_RETURN (sizeof(struct JS_DATA_TYPE))
# include <usb.h>
# endif
# elif defined(__FreeBSD__)
# include <usb.h>
# endif
# elif defined(__FreeBSD__)
+# if __FreeBSD_version < 500000
+# include <libusbhid.h>
+# else
+/*
+ * XXX The below hack is done until freeglut's autoconf is updated.
+ */
+# define HAVE_USBHID_H 1
+# include <usbhid.h>
+# endif
# endif
# include <dev/usb/usb.h>
# include <dev/usb/usbhid.h>
# endif
# include <dev/usb/usb.h>
# include <dev/usb/usbhid.h>
int tmp_buttons;
float tmp_axes [ _JS_MAX_AXES ];
# else
int tmp_buttons;
float tmp_axes [ _JS_MAX_AXES ];
# else
rv = IOServiceGetMatchingServices(masterPort, hidMatch, &hidIterator);
if (rv != kIOReturnSuccess || !hidIterator) {
rv = IOServiceGetMatchingServices(masterPort, hidMatch, &hidIterator);
if (rv != kIOReturnSuccess || !hidIterator) {
- fgWarning ( "%s", "no joystick (HID) devices found");
+ fgWarning( "%s", "no joystick (HID) devices found" );
/* Inspired by
http://msdn.microsoft.com/archive/en-us/dnargame/html/msdn_sidewind3d.asp
*/
/* Inspired by
http://msdn.microsoft.com/archive/en-us/dnargame/html/msdn_sidewind3d.asp
*/
-# pragma comment (lib, "advapi32.lib")
+# if defined(_MSC_VER)
+# pragma comment (lib, "advapi32.lib")
+# endif
static int fghJoystickGetOEMProductName ( SFG_Joystick* joy, char *buf, int buf_sz )
{
static int fghJoystickGetOEMProductName ( SFG_Joystick* joy, char *buf, int buf_sz )
{
ref = CFDictionaryGetValue (properties, CFSTR("USB Product Name"));
if (!ref || !CFStringGetCString ((CFStringRef) ref, name, 128, CFStringGetSystemEncoding ())) {
ref = CFDictionaryGetValue (properties, CFSTR("USB Product Name"));
if (!ref || !CFStringGetCString ((CFStringRef) ref, name, 128, CFStringGetSystemEncoding ())) {
- fgWarning ( "%s", "error getting device name");
+ fgWarning( "%s", "error getting device name" );
* PWO: These jsJoystick class methods have not been implemented.
* We might consider adding such functions to freeglut-2.0.
*/
* PWO: These jsJoystick class methods have not been implemented.
* We might consider adding such functions to freeglut-2.0.
*/
-int getNumAxes ( int ident )
+int glutJoystickGetNumAxes ( int ident )
{ return fgJoystick[ident]->num_axes; }
{ return fgJoystick[ident]->num_axes; }
-int notWorking ( int ident )
+int glutJoystickNotWorking ( int ident )
{ return fgJoystick[ident]->error; }
{ return fgJoystick[ident]->error; }
-float getDeadBand ( int ident, int axis )
+float glutJoystickGetDeadBand ( int ident, int axis )
{ return fgJoystick[ident]->dead_band [ axis ]; }
{ return fgJoystick[ident]->dead_band [ axis ]; }
-void setDeadBand ( int ident, int axis, float db )
+void glutJoystickSetDeadBand ( int ident, int axis, float db )
{ fgJoystick[ident]->dead_band [ axis ] = db; }
{ fgJoystick[ident]->dead_band [ axis ] = db; }
-float getSaturation ( int ident, int axis )
+float glutJoystickGetSaturation ( int ident, int axis )
{ return fgJoystick[ident]->saturate [ axis ]; }
{ return fgJoystick[ident]->saturate [ axis ]; }
-void setSaturation ( int ident, int axis, float st )
+void glutJoystickSetSaturation ( int ident, int axis, float st )
{ fgJoystick[ident]->saturate [ axis ] = st; }
{ fgJoystick[ident]->saturate [ axis ] = st; }
-void setMinRange ( int ident, float *axes )
+void glutJoystickSetMinRange ( int ident, float *axes )
{ memcpy ( fgJoystick[ident]->min , axes, fgJoystick[ident]->num_axes * sizeof(float) ); }
{ memcpy ( fgJoystick[ident]->min , axes, fgJoystick[ident]->num_axes * sizeof(float) ); }
-void setMaxRange ( int ident, float *axes )
+void glutJoystickSetMaxRange ( int ident, float *axes )
{ memcpy ( fgJoystick[ident]->max , axes, fgJoystick[ident]->num_axes * sizeof(float) ); }
{ memcpy ( fgJoystick[ident]->max , axes, fgJoystick[ident]->num_axes * sizeof(float) ); }
-void setCenter ( int ident, float *axes )
+void glutJoystickSetCenter ( int ident, float *axes )
{ memcpy ( fgJoystick[ident]->center, axes, fgJoystick[ident]->num_axes * sizeof(float) ); }
{ memcpy ( fgJoystick[ident]->center, axes, fgJoystick[ident]->num_axes * sizeof(float) ); }
-void getMinRange ( int ident, float *axes )
+void glutJoystickGetMinRange ( int ident, float *axes )
{ memcpy ( axes, fgJoystick[ident]->min , fgJoystick[ident]->num_axes * sizeof(float) ); }
{ memcpy ( axes, fgJoystick[ident]->min , fgJoystick[ident]->num_axes * sizeof(float) ); }
-void getMaxRange ( int ident, float *axes )
+void glutJoystickGetMaxRange ( int ident, float *axes )
{ memcpy ( axes, fgJoystick[ident]->max , fgJoystick[ident]->num_axes * sizeof(float) ); }
{ memcpy ( axes, fgJoystick[ident]->max , fgJoystick[ident]->num_axes * sizeof(float) ); }
-void getCenter ( int ident, float *axes )
+void glutJoystickGetCenter ( int ident, float *axes )
{ memcpy ( axes, fgJoystick[ident]->center, fgJoystick[ident]->num_axes * sizeof(float) ); }
/*** END OF FILE ***/
{ memcpy ( axes, fgJoystick[ident]->center, fgJoystick[ident]->num_axes * sizeof(float) ); }
/*** END OF FILE ***/