MAGE  v0.171.0
Matthias Advanced Game Engine
mage::input::Manager::Impl Class Reference

Public Member Functions

 Impl (NotNull< HWND > window)
 
 Impl (const Impl &manager)=delete
 
 Impl (Impl &&manager) noexcept
 
 ~Impl ()
 
Imploperator= (const Impl &manager)=delete
 
Imploperator= (Impl &&manager)=delete
 
NotNull< HWND > GetWindow () noexcept
 
void Update () noexcept
 
const KeyboardGetKeyboard () const noexcept
 
const MouseGetMouse () const noexcept
 

Private Member Functions

void InitializeDI ()
 
void InitializeInputSystems ()
 

Private Attributes

NotNull< HWND > m_window
 
ComPtr< IDirectInput8 > m_di
 
UniquePtr< Keyboardm_keyboard
 
UniquePtr< Mousem_mouse
 

Detailed Description

A class of input managers.

Constructor & Destructor Documentation

◆ Impl() [1/3]

mage::input::Manager::Impl::Impl ( NotNull< HWND >  window)
explicit

Constructs an input manager for the given window handle.

Parameters
[in]windowThe handle of the parent window.
Exceptions
ExceptionFailed to initialize the DirectInput object.
ExceptionFailed to initialize the input systems.

◆ Impl() [2/3]

mage::input::Manager::Impl::Impl ( const Impl manager)
delete

Constructs an input manager from the given input manager.

Parameters
[in]managerA reference to the input manager to copy.

◆ Impl() [3/3]

mage::input::Manager::Impl::Impl ( Impl &&  manager)
defaultnoexcept

Constructs an input manager by moving the given input manager.

Parameters
[in]managerA reference to the input manager to move.

◆ ~Impl()

mage::input::Manager::Impl::~Impl ( )
default

Destructs this input manager.

Member Function Documentation

◆ GetKeyboard()

const Keyboard& mage::input::Manager::Impl::GetKeyboard ( ) const
noexcept

Returns the keyboard of this input manager.

Returns
A reference to the keyboard of this input manager.

◆ GetMouse()

const Mouse& mage::input::Manager::Impl::GetMouse ( ) const
noexcept

Returns the mouse of this input manager.

Returns
A reference to the mouse of this input manager.

◆ GetWindow()

NotNull< HWND > mage::input::Manager::Impl::GetWindow ( )
noexcept

Returns the window handle of this input manager.

Returns
The window handle of this input manager.

◆ InitializeDI()

void mage::input::Manager::Impl::InitializeDI ( )
private

Initializes the DirectInput object of this input manager.

Exceptions
ExceptionFailed to initialize the DirectInput object.

◆ InitializeInputSystems()

void mage::input::Manager::Impl::InitializeInputSystems ( )
private

Initializes the different input systems of this input manager.

Exceptions
ExceptionFailed to initialize the input systems.

◆ operator=() [1/2]

Impl& mage::input::Manager::Impl::operator= ( const Impl manager)
delete

Copies the given input manager to this input manager.

Parameters
[in]managerA reference to the input manager to copy.
Returns
A reference to the copy of the given input manager (i.e. this input manager).

◆ operator=() [2/2]

Impl& mage::input::Manager::Impl::operator= ( Impl &&  manager)
delete

Moves the given input manager to this input manager.

Parameters
[in]managerA reference to the input manager to move.
Returns
A reference to the moved input manager (i.e. this input manager).

◆ Update()

void mage::input::Manager::Impl::Update ( )
noexcept

Updates the state of the input systems of this input manager.

Member Data Documentation

◆ m_di

ComPtr< IDirectInput8 > mage::input::Manager::Impl::m_di
private

A pointer to the DirectInput object of this input manager.

The methods of the IDirectInput8 interface are used to enumerate, create, and retrieve the status of Microsoft DirectInput device.

◆ m_keyboard

UniquePtr< Keyboard > mage::input::Manager::Impl::m_keyboard
private

A pointer to the keyboard of this input manager.

◆ m_mouse

UniquePtr< Mouse > mage::input::Manager::Impl::m_mouse
private

A pointer to the mouse of this input manager.

◆ m_window

NotNull< HWND > mage::input::Manager::Impl::m_window
private

The handle of the parent window of this input manager.