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 ()=default
 
 ~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_
 

Detailed Description

Definition at line 15 of file input_manager.h.

Constructor & Destructor Documentation

◆ InputManager()

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

◆ ~InputManager()

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

Definition at line 18 of file input_manager.h.

References Shutdown().

Here is the call graph for this function:

Member Function Documentation

◆ Initialize() [1/2]

◆ Initialize() [2/2]

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

Definition at line 31 of file input_manager.cc.

References backend(), backend_, and LOG_INFO.

Here is the call graph for this function:

◆ Shutdown()

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

Definition at line 40 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 47 of file input_manager.cc.

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

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

Here is the call graph for this function:

◆ ProcessEvent()

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

Definition at line 71 of file input_manager.cc.

References backend_.

◆ backend() [1/2]

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

Definition at line 26 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 27 of file input_manager.h.

References backend_.

◆ IsInitialized()

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

Definition at line 29 of file input_manager.h.

References backend_.

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

◆ GetConfig()

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

Definition at line 77 of file input_manager.cc.

References backend_.

Referenced by yaze::emu::ui::RenderKeyboardConfig().

◆ SetConfig()

void yaze::emu::input::InputManager::SetConfig ( const InputConfig config)

Definition at line 84 of file input_manager.cc.

References backend_.

Referenced by yaze::emu::ui::RenderKeyboardConfig().

◆ PressButton()

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

◆ ReleaseButton()

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

Definition at line 94 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 40 of file input_manager.h.

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


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