X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3096bd2fa7b88105bc54c08e3c878585de1a9b91..9c9c3d7a8f6c4ee3481674e901d34714ee18915d:/src/msw/joystick.cpp diff --git a/src/msw/joystick.cpp b/src/msw/joystick.cpp index cd636fba81..1cfed85842 100644 --- a/src/msw/joystick.cpp +++ b/src/msw/joystick.cpp @@ -6,7 +6,7 @@ // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -24,8 +24,8 @@ #include "wx/window.h" #include "wx/msw/private.h" -#if !defined( __GNUWIN32__ ) || defined(wxUSE_NORLANDER_HEADERS) -#include +#if !defined(__GNUWIN32_OLD__) || defined(__CYGWIN10__) + #include #endif #if !defined(__WIN32__) && !defined(_MMRESULT_) @@ -33,12 +33,10 @@ typedef UINT MMRESULT; #endif #ifndef __TWIN32__ -#ifdef __GNUWIN32__ -#ifndef wxUSE_NORLANDER_HEADERS +#ifdef __GNUWIN32_OLD__ #include "wx/msw/gnuwin32/extra.h" #endif #endif -#endif // Why doesn't BC++ have joyGetPosEx? #if !defined(__WIN32__) || defined(__BORLANDC__) || defined(__TWIN32__) @@ -53,7 +51,38 @@ IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject) // Attributes //////////////////////////////////////////////////////////////////////////// -wxPoint wxJoystick::GetPosition(void) const +/** + johan@linkdata.se 2002-08-20: + Now returns only valid, functioning + joysticks, counting from the first + available and upwards. +*/ +wxJoystick::wxJoystick(int joystick) +{ + JOYINFO joyInfo; + int i, maxsticks; + + maxsticks = joyGetNumDevs(); + for( i=0; i 0) || (res == JOYERR_NOERROR)); -} - -int wxJoystick::GetNumberJoysticks(void) const + int i, maxsticks, actualsticks; + maxsticks = joyGetNumDevs(); + actualsticks = 0; + for( i=0; i