#include <input_manager.h>
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) |
IInputBackend * | backend () |
const IInputBackend * | backend () 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< IInputBackend > | backend_ |
ControllerState | agent_controller_state_ |
Definition at line 15 of file input_manager.h.
|
default |
|
inline |
Definition at line 18 of file input_manager.h.
References Shutdown().
bool yaze::emu::input::InputManager::Initialize | ( | InputBackendFactory::BackendType | type = InputBackendFactory::BackendType::SDL2 | ) |
Definition at line 10 of file input_manager.cc.
References backend_, yaze::emu::input::InputConfig::continuous_polling, yaze::emu::input::InputBackendFactory::Create(), yaze::emu::input::InputConfig::enable_gamepad, LOG_ERROR, and LOG_INFO.
Referenced by yaze::emu::Emulator::Run().
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.
void yaze::emu::input::InputManager::Shutdown | ( | ) |
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().
void yaze::emu::input::InputManager::ProcessEvent | ( | void * | event | ) |
Definition at line 71 of file input_manager.cc.
References 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().
|
inline |
Definition at line 27 of file input_manager.h.
References backend_.
|
inline |
Definition at line 29 of file input_manager.h.
References backend_.
Referenced by yaze::emu::Emulator::Run().
InputConfig yaze::emu::input::InputManager::GetConfig | ( | ) | const |
Definition at line 77 of file input_manager.cc.
References backend_.
Referenced by yaze::emu::ui::RenderKeyboardConfig().
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().
void yaze::emu::input::InputManager::PressButton | ( | SnesButton | button | ) |
Definition at line 90 of file input_manager.cc.
References agent_controller_state_, and yaze::emu::input::ControllerState::SetButton().
Referenced by yaze::agent::EmulatorServiceImpl::HoldButtons(), and yaze::agent::EmulatorServiceImpl::PressButtons().
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().
|
private |
Definition at line 39 of file input_manager.h.
Referenced by backend(), backend(), GetConfig(), Initialize(), Initialize(), IsInitialized(), Poll(), ProcessEvent(), SetConfig(), and Shutdown().
|
private |
Definition at line 40 of file input_manager.h.
Referenced by Poll(), PressButton(), and ReleaseButton().