![]() |
MAGE
v0.171.0
Matthias Advanced Game Engine
|
#include <mouse.hpp>
Public Member Functions | |
Mouse (NotNull< HWND > window, IDirectInput8 &di) | |
Mouse (const Mouse &mouse)=delete | |
Mouse (Mouse &&mouse) noexcept | |
~Mouse () | |
Mouse & | operator= (const Mouse &mouse)=delete |
Mouse & | operator= (Mouse &&mouse)=delete |
NotNull< HWND > | GetWindow () noexcept |
void | Update () noexcept |
bool | IsActive (U8 button) const noexcept |
bool | IsPassive (U8 button) const noexcept |
bool | IsSwitched (U8 button) const noexcept |
bool | IsActivated (U8 button) const noexcept |
bool | IsDeactivated (U8 button) const noexcept |
S32 | GetPositionX () const noexcept |
S32 | GetPositionY () const noexcept |
const S32x2 | GetPosition () const noexcept |
S32 | GetDeltaX () const noexcept |
S32 | GetDeltaY () const noexcept |
const S32x2 | GetDelta () const noexcept |
S32 | GetDeltaWheel () const noexcept |
Private Member Functions | |
void | InitializeMouse () |
Private Attributes | |
NotNull< HWND > | m_window |
IDirectInput8 & | m_di |
ComPtr< IDirectInputDevice8 > | m_mouse |
S32x2 | m_position |
S32x2 | m_delta |
S32 | m_delta_wheel |
std::bitset< 16 > | m_button_states |
A class of mouses.
|
explicit |
Constructs a mouse.
[in] | window | The handle of the parent window. |
[in,out] | di | A reference to a direct input object. |
Exception | Failed to initialize the mouse. |
|
delete |
Constructs a mouse from the given mouse.
[in] | mouse | A reference to the mouse to copy. |
|
defaultnoexcept |
Constructs a mouse by moving the given mouse.
[in] | mouse | A reference to the mouse to move. |
|
default |
Destructs this mouse.
|
noexcept |
Returns the change in this mouse's coordinates.
|
noexcept |
Returns the change in this mouse's scroll wheel.
|
noexcept |
Returns the change in this mouse's horizontal coordinate.
|
noexcept |
Returns the change in this mouse's vertical coordinate.
|
noexcept |
Returns the position of this mouse.
|
noexcept |
Returns the horizontal position of this mouse.
|
noexcept |
Returns the vertical position of this mouse.
|
noexcept |
Returns the window handle of this mouse.
|
private |
Initializes the mouse device of this mouse.
Exception | Failed to initialize the mouse. |
|
noexcept |
Checks whether the given button is activated.
[in] | button | The button. |
true
if the given button is activated. false
otherwise.
|
noexcept |
Checks whether the given button is active.
[in] | button | The button. |
true
if the given button is active. false
otherwise.
|
noexcept |
Checks whether the given button is deactivated.
[in] | button | The button. |
true
if the given button is deactivated. false
otherwise.
|
noexcept |
Checks whether the given button is passive.
[in] | button | The button. |
true
if the given button is passive. false
otherwise.
|
noexcept |
Checks whether the given button is switched from being passive to active or vice versa (i.e. activated or deactivated).
[in] | button | The button. |
true
if the given button is switched from being passive to active or vice versa (i.e. activated or deactivated). false
otherwise. Copies the given mouse to this mouse.
[in] | mouse | A reference to the mouse to copy. |
Moves the given mouse to this mouse.
[in] | mouse | A reference to the mouse to move. |
|
noexcept |
Updates the state of this mouse.
|
private |
The button states of this mouse. Each button state consists of two flags.
The first flag indicates whether the button state switched from being passive to active or vice versa (i.e. activated or deactivated).
The second flag indicates whether the button state is active.
|
private |
The change in the horizontal and vertical coordinates of this mouse.
|
private |
The change in the scroll wheel coordinates of this mouse.
|
private |
A reference to the DirectInput object of this mouse.
|
private |
A pointer to the DirectInput mouse device of this mouse.
|
private |
The position of the mouse cursor on the screen of this mouse.
|
private |
The handle of the parent window of this mouse.