X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c42404a58eac2c9eb0557565a471a794c387a715..05159a2750ed2cc5945a85bc5fc6849ad1a30e75:/src/msw/joystick.cpp diff --git a/src/msw/joystick.cpp b/src/msw/joystick.cpp index 28c0752f05..1cfed85842 100644 --- a/src/msw/joystick.cpp +++ b/src/msw/joystick.cpp @@ -24,7 +24,7 @@ #include "wx/window.h" #include "wx/msw/private.h" -#ifndef __GNUWIN32_OLD__ +#if !defined(__GNUWIN32_OLD__) || defined(__CYGWIN10__) #include #endif @@ -51,6 +51,37 @@ IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject) // Attributes //////////////////////////////////////////////////////////////////////////// +/** + 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() const + int i, maxsticks, actualsticks; + maxsticks = joyGetNumDevs(); + actualsticks = 0; + for( i=0; i