joysticks attached to the computer is a global property, not one of the
specific instance. Patch from Lauri Nurmi.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36284
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
14 files changed:
\membersection{wxJoystick::GetNumberJoysticks}\label{wxjoystickgetnumberjoysticks}
\membersection{wxJoystick::GetNumberJoysticks}\label{wxjoystickgetnumberjoysticks}
-\constfunc{int}{GetNumberJoysticks}{\void}
+\func{static int}{GetNumberJoysticks}{\void}
Returns the number of joysticks currently attached to the computer.
Returns the number of joysticks currently attached to the computer.
////////////////////////////////////////////////////////////////////////////
bool IsOk() const; // Checks that the joystick is functioning
////////////////////////////////////////////////////////////////////////////
bool IsOk() const; // Checks that the joystick is functioning
- int GetNumberJoysticks() const ;
+ static int GetNumberJoysticks() ;
int GetManufacturerId() const ;
int GetProductId() const ;
wxString GetProductName() const ;
int GetManufacturerId() const ;
int GetProductId() const ;
wxString GetProductName() const ;
////////////////////////////////////////////////////////////////////////////
bool IsOk() const; // Checks that the joystick is functioning
////////////////////////////////////////////////////////////////////////////
bool IsOk() const; // Checks that the joystick is functioning
- int GetNumberJoysticks() const ;
+ static int GetNumberJoysticks() ;
int GetManufacturerId() const ;
int GetProductId() const ;
wxString GetProductName() const ;
int GetManufacturerId() const ;
int GetProductId() const ;
wxString GetProductName() const ;
////////////////////////////////////////////////////////////////////////////
bool IsOk() const; // Checks that the joystick is functioning
////////////////////////////////////////////////////////////////////////////
bool IsOk() const; // Checks that the joystick is functioning
- int GetNumberJoysticks() const ;
+ static int GetNumberJoysticks() ;
int GetManufacturerId() const ;
int GetProductId() const ;
wxString GetProductName() const ;
int GetManufacturerId() const ;
int GetProductId() const ;
wxString GetProductName() const ;
////////////////////////////////////////////////////////////////////////////
bool IsOk() const; // Checks that the joystick is functioning
////////////////////////////////////////////////////////////////////////////
bool IsOk() const; // Checks that the joystick is functioning
- int GetNumberJoysticks() const ;
+ static int GetNumberJoysticks() ;
int GetManufacturerId() const ;
int GetProductId() const ;
wxString GetProductName() const ;
int GetManufacturerId() const ;
int GetProductId() const ;
wxString GetProductName() const ;
////////////////////////////////////////////////////////////////////////////
bool IsOk() const; // Checks that the joystick is functioning
////////////////////////////////////////////////////////////////////////////
bool IsOk() const; // Checks that the joystick is functioning
- int GetNumberJoysticks() const ;
+ static int GetNumberJoysticks() ;
int GetManufacturerId() const ;
int GetProductId() const ;
wxString GetProductName() const ;
int GetManufacturerId() const ;
int GetProductId() const ;
wxString GetProductName() const ;
////////////////////////////////////////////////////////////////////////////
bool IsOk() const; // Checks that the joystick is functioning
////////////////////////////////////////////////////////////////////////////
bool IsOk() const; // Checks that the joystick is functioning
- int GetNumberJoysticks() const ;
+ static int GetNumberJoysticks() ;
int GetManufacturerId() const ;
int GetProductId() const ;
wxString GetProductName() const ;
int GetManufacturerId() const ;
int GetProductId() const ;
wxString GetProductName() const ;
#if wxUSE_STATUSBAR
frame->CreateStatusBar();
#if wxUSE_STATUSBAR
frame->CreateStatusBar();
- frame->SetStatusText(wxString::Format(wxT("Device [%s] (PID:[%i] MID:[%i]) Ready... # of joysticks:[%i]"), stick.GetProductName().c_str(), stick.GetProductId(), stick.GetManufacturerId(), stick.GetNumberJoysticks()));
+ frame->SetStatusText(wxString::Format(wxT("Device [%s] (PID:[%i] MID:[%i]) Ready... # of joysticks:[%i]"), stick.GetProductName().c_str(), stick.GetProductId(), stick.GetManufacturerId(), wxJoystick::GetNumberJoysticks()));
#endif // wxUSE_STATUSBAR
frame->CenterOnScreen();
#endif // wxUSE_STATUSBAR
frame->CenterOnScreen();
-int wxJoystick::GetNumberJoysticks() const
+int wxJoystick::GetNumberJoysticks()
-int wxJoystick::GetNumberJoysticks() const
+int wxJoystick::GetNumberJoysticks()
// is all devices with the kHIDUsage_GD_Joystick or kHIDUsage_GD_GamePad
// identifiers.
//---------------------------------------------------------------------------
// is all devices with the kHIDUsage_GD_Joystick or kHIDUsage_GD_GamePad
// identifiers.
//---------------------------------------------------------------------------
-int wxJoystick::GetNumberJoysticks() const
+int wxJoystick::GetNumberJoysticks()
{
return
wxHIDDevice::GetCount(kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick) +
{
return
wxHIDDevice::GetCount(kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick) +
-int wxJoystick::GetNumberJoysticks() const
+int wxJoystick::GetNumberJoysticks()
return (m_device != -1);
}
return (m_device != -1);
}
-int wxJoystick::GetNumberJoysticks() const
+int wxJoystick::GetNumberJoysticks()
{
wxString dev_name;
int fd, j;
{
wxString dev_name;
int fd, j;
-int wxJoystick::GetNumberJoysticks() const
+int wxJoystick::GetNumberJoysticks()