OpenBarnyard
 
Loading...
Searching...
No Matches
AInputHandler.h
Go to the documentation of this file.
1#pragma once
2#include <Toshi/TTask.h>
6#include <Toshi/T2Vector.h>
7
8class AInputHandler : public Toshi::TTask
9 , public Toshi::TSingleton<AInputHandler>
10{
11public:
12 TDECLARE_CLASS( AInputHandler, Toshi::TTask );
13
14public:
17
18 virtual TBOOL OnCreate() override;
19 virtual TBOOL OnUpdate( TFLOAT a_fDeltaTime ) override;
20
21 Toshi::TInputDeviceMouse* GetMouseDevice() const { return m_pMouseDevice; }
22 Toshi::TInputDeviceKeyboard* GetKeyboardDevice() const { return m_pKeyboardDevice; }
23
24 TBOOL HadInputLastFrame() const { return m_bHadInputLastFrame; }
25
26private:
27 TBOOL ProcessInputEvent( Toshi::TInputInterface* a_pInputInterface, Toshi::TInputInterface::InputEvent* a_pEvent );
28
29private:
30 Toshi::TInputDeviceMouse* m_pMouseDevice;
31 Toshi::TInputDeviceKeyboard* m_pKeyboardDevice;
32 Toshi::T2Vector<Toshi::TInputDevice*, 8> m_Devices;
33 Toshi::TInputDeviceController* m_pMainController;
34 // ...
35 Toshi::TListener<Toshi::TInputInterface, Toshi::TInputInterface::InputEvent, AInputHandler> m_InputListener;
36 // ...
37 TFLOAT m_fDeltaTime;
38 TBOOL m_bIsPaused;
39 TBOOL m_bHadInputLastFrame;
40};
Controller input device interface for the Toshi engine.
Keyboard input device for the Toshi engine.
Mouse input device for the Toshi engine.
#define TDECLARE_CLASS(THIS_CLASS, PARENT_CLASS)
Definition TObject.h:38
float TFLOAT
Definition Typedefs.h:4
bool TBOOL
Definition Typedefs.h:6
TBOOL HadInputLastFrame() const
Toshi::TInputDeviceMouse * GetMouseDevice() const
Toshi::TInputDeviceKeyboard * GetKeyboardDevice() const
virtual TBOOL OnUpdate(TFLOAT a_fDeltaTime) override
virtual TBOOL OnCreate() override