git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@426
7f0cb862-5218-0410-a997-
914c9d46530a
/*
* PWO: I don't like it at all. It's a mess. Could it be cleared?
*/
/*
* PWO: I don't like it at all. It's a mess. Could it be cleared?
*/
+#ifdef TARGET_HOST_WIN32
# include <windows.h>
# if defined( __CYGWIN32__ ) || defined( __CYGWIN__ )
# define NEAR /* */
# include <windows.h>
# if defined( __CYGWIN32__ ) || defined( __CYGWIN__ )
# define NEAR /* */
+#ifdef TARGET_HOST_WIN32
# define _JS_MAX_AXES 6
#else
# ifdef __FreeBSD__
# define _JS_MAX_AXES 6
#else
# ifdef __FreeBSD__
+#ifdef TARGET_HOST_WIN32
JOYINFOEX js;
UINT js_id;
#else
JOYINFOEX js;
UINT js_id;
#else
*/
static void fghJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes )
{
*/
static void fghJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes )
{
+#ifdef TARGET_HOST_WIN32
MMRESULT status;
#else
int status;
MMRESULT status;
#else
int status;
+#ifdef TARGET_HOST_WIN32
status = joyGetPosEx( joy->js_id, &joy->js );
if( status != JOYERR_NOERROR )
status = joyGetPosEx( joy->js_id, &joy->js );
if( status != JOYERR_NOERROR )
*/
static void fghJoystickOpen( SFG_Joystick* joy )
{
*/
static void fghJoystickOpen( SFG_Joystick* joy )
{
+#ifdef TARGET_HOST_WIN32
fgJoystick = ( SFG_Joystick * )calloc( sizeof( SFG_Joystick ), 1 );
fgJoystick = ( SFG_Joystick * )calloc( sizeof( SFG_Joystick ), 1 );
+#ifdef TARGET_HOST_WIN32
switch( ident )
{
case 0:
switch( ident )
{
case 0:
if( !fgJoystick )
fgError( "illegal attempt to deinitialize joystick device" );
if( !fgJoystick )
fgError( "illegal attempt to deinitialize joystick device" );
+#ifndef TARGET_HOST_WIN32
if( ! fgJoystick->error )
close( fgJoystick->fd );
#endif
if( ! fgJoystick->error )
close( fgJoystick->fd );
#endif