yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::emu::input::InputManager Class Reference

#include <input_manager.h>

Collaboration diagram for yaze::emu::input::InputManager:

Public Member Functions

 InputManager ()
 
 ~InputManager ()
 
bool Initialize (InputBackendFactory::BackendType type=InputBackendFactory::BackendType::SDL2)
 
void Initialize (std::unique_ptr< IInputBackend > backend)
 
void Shutdown ()
 
void Poll (Snes *snes, int player=1)
 
void ProcessEvent (void *event)
 
IInputBackendbackend ()
 
const IInputBackendbackend () const
 
bool IsInitialized () const
 
InputConfig GetConfig () const
 
void SetConfig (const InputConfig &config)
 
void PressButton (SnesButton button)
 
void ReleaseButton (SnesButton button)
 

Private Attributes

std::unique_ptr< IInputBackendbackend_
 
ControllerState agent_controller_state_
 
InputConfig config_
 

Detailed Description

Definition at line 16 of file input_manager.h.

Constructor & Destructor Documentation

◆ InputManager()

yaze::emu::input::InputManager::InputManager ( )

◆ ~InputManager()

yaze::emu::input::InputManager::~InputManager ( )
inline

Definition at line 19 of file input_manager.h.

References Shutdown().

Here is the call graph for this function:

Member Function Documentation

◆ Initialize() [1/2]

bool yaze::emu::input::InputManager::Initialize ( InputBackendFactory::BackendType type = InputBackendFactory::BackendType::SDL2)

Definition at line 17 of file input_manager.cc.

References yaze::emu::input::ApplyDefaultKeyBindings(), backend_, config_, yaze::emu::input::InputBackendFactory::Create(), LOG_ERROR, and LOG_INFO.

Referenced by main(), and yaze::emu::Emulator::Run().

Here is the call graph for this function:

◆ Initialize() [2/2]

void yaze::emu::input::InputManager::Initialize ( std::unique_ptr< IInputBackend > backend)

Definition at line 38 of file input_manager.cc.

References yaze::emu::input::ApplyDefaultKeyBindings(), backend(), backend_, config_, and LOG_INFO.

Here is the call graph for this function:

◆ Shutdown()

void yaze::emu::input::InputManager::Shutdown ( )

Definition at line 52 of file input_manager.cc.

References backend_.

Referenced by ~InputManager().

◆ Poll()

void yaze::emu::input::InputManager::Poll ( Snes * snes,
int player = 1 )

Definition at line 59 of file input_manager.cc.

References agent_controller_state_, backend_, yaze::emu::input::ControllerState::buttons, LOG_INFO, and yaze::emu::Snes::SetButtonState().

Referenced by main(), and yaze::emu::Emulator::Run().

Here is the call graph for this function:

◆ ProcessEvent()

void yaze::emu::input::InputManager::ProcessEvent ( void * event)

Definition at line 86 of file input_manager.cc.

References backend_.

◆ backend() [1/2]

IInputBackend * yaze::emu::input::InputManager::backend ( )
inline

Definition at line 28 of file input_manager.h.

References backend_.

Referenced by Initialize(), yaze::emu::ui::RenderKeyboardConfig(), and yaze::emu::Emulator::Run().

◆ backend() [2/2]

const IInputBackend * yaze::emu::input::InputManager::backend ( ) const
inline

Definition at line 29 of file input_manager.h.

References backend_.

◆ IsInitialized()

bool yaze::emu::input::InputManager::IsInitialized ( ) const
inline

Definition at line 31 of file input_manager.h.

References backend_.

Referenced by yaze::emu::Emulator::Run().

◆ GetConfig()

InputConfig yaze::emu::input::InputManager::GetConfig ( ) const

◆ SetConfig()

◆ PressButton()

void yaze::emu::input::InputManager::PressButton ( SnesButton button)

◆ ReleaseButton()

void yaze::emu::input::InputManager::ReleaseButton ( SnesButton button)

Definition at line 124 of file input_manager.cc.

References agent_controller_state_, and yaze::emu::input::ControllerState::SetButton().

Referenced by yaze::agent::EmulatorServiceImpl::ReleaseButtons().

Here is the call graph for this function:

Member Data Documentation

◆ backend_

std::unique_ptr<IInputBackend> yaze::emu::input::InputManager::backend_
private

◆ agent_controller_state_

ControllerState yaze::emu::input::InputManager::agent_controller_state_
private

Definition at line 42 of file input_manager.h.

Referenced by Poll(), PressButton(), and ReleaseButton().

◆ config_

InputConfig yaze::emu::input::InputManager::config_
private

Definition at line 43 of file input_manager.h.

Referenced by GetConfig(), Initialize(), Initialize(), InputManager(), and SetConfig().


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