diff options
Diffstat (limited to 'src/SFML/Window/Win32/JoystickImpl.hpp')
-rw-r--r-- | src/SFML/Window/Win32/JoystickImpl.hpp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/SFML/Window/Win32/JoystickImpl.hpp b/src/SFML/Window/Win32/JoystickImpl.hpp index 8affc27..268657d 100644 --- a/src/SFML/Window/Win32/JoystickImpl.hpp +++ b/src/SFML/Window/Win32/JoystickImpl.hpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. @@ -39,7 +39,6 @@ #define DIRECTINPUT_VERSION 0x0800 #include <SFML/Window/Joystick.hpp> #include <SFML/Window/JoystickImpl.hpp> -#include <SFML/System/String.hpp> #include <windows.h> #include <mmsystem.h> #include <dinput.h> @@ -186,12 +185,20 @@ public: JoystickCaps getCapabilitiesDInput() const; //////////////////////////////////////////////////////////// - /// \brief Update the joystick and get its new state (DInput) + /// \brief Update the joystick and get its new state (DInput, Buffered) /// /// \return Joystick state /// //////////////////////////////////////////////////////////// - JoystickState updateDInput(); + JoystickState updateDInputBuffered(); + + //////////////////////////////////////////////////////////// + /// \brief Update the joystick and get its new state (DInput, Polled) + /// + /// \return Joystick state + /// + //////////////////////////////////////////////////////////// + JoystickState updateDInputPolled(); private: @@ -220,13 +227,15 @@ private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// - unsigned int m_index; ///< Index of the joystick - JOYCAPS m_caps; ///< Joystick capabilities - IDirectInputDevice8W* m_device; ///< DirectInput 8.x device - DIDEVCAPS m_deviceCaps; ///< DirectInput device capabilities - int m_axes[Joystick::AxisCount]; ///< Offsets to the bytes containing the axes states, -1 if not available - int m_buttons[Joystick::ButtonCount]; ///< Offsets to the bytes containing the button states, -1 if not available - Joystick::Identification m_identification; ///< Joystick identification + unsigned int m_index; //!< Index of the joystick + JOYCAPS m_caps; //!< Joystick capabilities + IDirectInputDevice8W* m_device; //!< DirectInput 8.x device + DIDEVCAPS m_deviceCaps; //!< DirectInput device capabilities + int m_axes[Joystick::AxisCount]; //!< Offsets to the bytes containing the axes states, -1 if not available + int m_buttons[Joystick::ButtonCount]; //!< Offsets to the bytes containing the button states, -1 if not available + Joystick::Identification m_identification; //!< Joystick identification + JoystickState m_state; //!< Buffered joystick state + bool m_buffered; //!< true if the device uses buffering, false if the device uses polling }; } // namespace priv |