Fling Engine  0.00.1
Fling Engine is a game engine written in Vulkan
Public Types | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes
Fling::Input Class Referenceabstract

Base input class for polling input in the Fling Engine. More...

#include <Input.h>

Inherits Fling::NonCopyable.

Public Types

typedef std::map< std::string, Fling::KeyKeyMap
 
typedef std::pair< std::string, Fling::KeyKeyPair
 

Static Public Member Functions

static void Init ()
 Initialize the input instance on this platform. More...
 
static void Shutdown ()
 Shuts down input manager. More...
 
static void Poll ()
 Update any input polling that needs to happen on this platform. More...
 
static bool IsKeyDown (const std::string &t_KeyName)
 
static bool IsKeyHeld (const std::string &t_KeyName)
 
static bool IsMouseButtonPressed (const std::string &t_KeyName)
 
static bool IsMouseDown (const std::string &t_KeyName)
 
static MousePos GetMousePos ()
 Get the current mouse position in screen space. More...
 

Protected Member Functions

virtual void InitImpl ()=0
 
virtual void ShutdownImpl ()=0
 
virtual void PollImpl ()=0
 Poll for input from the keyboard. More...
 
virtual void InitKeyMap ()=0
 
virtual bool IsKeyDownImpl (const std::string &t_KeyName)=0
 
virtual bool IsKeyHelpImpl (const std::string &t_KeyName)=0
 
virtual bool IsMouseButtonPressedImpl (const std::string &t_KeyName)=0
 
virtual bool IsMouseDownImpl (const std::string &t_KeyName)=0
 
virtual MousePos GetMousePosImpl ()=0
 
- Protected Member Functions inherited from Fling::NonCopyable
 NonCopyable ()=default
 
virtual ~NonCopyable ()=default
 

Static Protected Member Functions

static void AddKeyMap (const std::string &t_Name, UINT32 t_KeyCode)
 Add a key mapping to this platform. More...
 

Static Protected Attributes

static KeyMap m_KeyMap
 The actual key map. More...
 
static Inputm_Instace
 Created by the implementation class. More...
 

Additional Inherited Members

- Public Member Functions inherited from Fling::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
 NonCopyable (NonCopyable &&)=default
 
NonCopyableoperator= (const NonCopyable &)=delete
 
NonCopyableoperator= (NonCopyable &&)=default
 

Detailed Description

Base input class for polling input in the Fling Engine.

Member Typedef Documentation

◆ KeyMap

typedef std::map<std::string, Fling::Key> Fling::Input::KeyMap

◆ KeyPair

typedef std::pair<std::string, Fling::Key> Fling::Input::KeyPair

Member Function Documentation

◆ AddKeyMap()

static void Fling::Input::AddKeyMap ( const std::string &  t_Name,
UINT32  t_KeyCode 
)
inlinestaticprotected

Add a key mapping to this platform.

Parameters
t_NameThe name of this key
t_KeyCodeThe KeyCode that maps this key to the current platform

◆ GetMousePos()

static MousePos Fling::Input::GetMousePos ( )
inlinestatic

Get the current mouse position in screen space.

◆ GetMousePosImpl()

virtual MousePos Fling::Input::GetMousePosImpl ( )
protectedpure virtual

◆ Init()

static void Fling::Input::Init ( )
inlinestatic

Initialize the input instance on this platform.

Handle and input mapping on this platform

◆ InitImpl()

virtual void Fling::Input::InitImpl ( )
protectedpure virtual

◆ InitKeyMap()

virtual void Fling::Input::InitKeyMap ( )
protectedpure virtual

◆ IsKeyDown()

static bool Fling::Input::IsKeyDown ( const std::string &  t_KeyName)
inlinestatic

◆ IsKeyDownImpl()

virtual bool Fling::Input::IsKeyDownImpl ( const std::string &  t_KeyName)
protectedpure virtual

◆ IsKeyHeld()

static bool Fling::Input::IsKeyHeld ( const std::string &  t_KeyName)
inlinestatic

◆ IsKeyHelpImpl()

virtual bool Fling::Input::IsKeyHelpImpl ( const std::string &  t_KeyName)
protectedpure virtual

◆ IsMouseButtonPressed()

static bool Fling::Input::IsMouseButtonPressed ( const std::string &  t_KeyName)
inlinestatic

◆ IsMouseButtonPressedImpl()

virtual bool Fling::Input::IsMouseButtonPressedImpl ( const std::string &  t_KeyName)
protectedpure virtual

◆ IsMouseDown()

static bool Fling::Input::IsMouseDown ( const std::string &  t_KeyName)
inlinestatic

◆ IsMouseDownImpl()

virtual bool Fling::Input::IsMouseDownImpl ( const std::string &  t_KeyName)
protectedpure virtual

◆ Poll()

static void Fling::Input::Poll ( )
inlinestatic

Update any input polling that needs to happen on this platform.

◆ PollImpl()

virtual void Fling::Input::PollImpl ( )
protectedpure virtual

Poll for input from the keyboard.

◆ Shutdown()

static void Fling::Input::Shutdown ( )
inlinestatic

Shuts down input manager.

Deletes the input implementation pointer.

◆ ShutdownImpl()

virtual void Fling::Input::ShutdownImpl ( )
protectedpure virtual

Field Documentation

◆ m_Instace

Input* Fling::Input::m_Instace
staticprotected

Created by the implementation class.

See also
WindowInput

◆ m_KeyMap

KeyMap Fling::Input::m_KeyMap
staticprotected

The actual key map.


The documentation for this class was generated from the following file: