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

SDL2 input backend implementation. More...

Inheritance diagram for yaze::emu::input::SDL2InputBackend:
Collaboration diagram for yaze::emu::input::SDL2InputBackend:

Public Member Functions

 SDL2InputBackend ()=default
 
 ~SDL2InputBackend () override
 
bool Initialize (const InputConfig &config) override
 Initialize the input backend.
 
void Shutdown () override
 Shutdown the input backend.
 
ControllerState Poll (int player) override
 Poll current input state (call every frame)
 
void ProcessEvent (void *event) override
 Process platform-specific events (optional)
 
InputConfig GetConfig () const override
 Get current configuration.
 
void SetConfig (const InputConfig &config) override
 Update configuration (hot-reload)
 
std::string GetBackendName () const override
 Get backend name for debugging.
 
bool IsInitialized () const override
 Check if backend is initialized.
 
- Public Member Functions inherited from yaze::emu::input::IInputBackend
virtual ~IInputBackend ()=default
 

Private Member Functions

void UpdateEventState (int keycode, bool pressed)
 

Private Attributes

InputConfig config_
 
bool initialized_ = false
 
ControllerState event_state_
 

Detailed Description

SDL2 input backend implementation.

Definition at line 14 of file input_backend.cc.

Constructor & Destructor Documentation

◆ SDL2InputBackend()

yaze::emu::input::SDL2InputBackend::SDL2InputBackend ( )
default

◆ ~SDL2InputBackend()

yaze::emu::input::SDL2InputBackend::~SDL2InputBackend ( )
inlineoverride

Definition at line 17 of file input_backend.cc.

References Shutdown().

Here is the call graph for this function:

Member Function Documentation

◆ Initialize()

◆ Shutdown()

void yaze::emu::input::SDL2InputBackend::Shutdown ( )
inlineoverridevirtual

Shutdown the input backend.

Implements yaze::emu::input::IInputBackend.

Definition at line 48 of file input_backend.cc.

References initialized_, and LOG_INFO.

Referenced by ~SDL2InputBackend().

◆ Poll()

◆ ProcessEvent()

void yaze::emu::input::SDL2InputBackend::ProcessEvent ( void *  event)
inlineoverridevirtual

Process platform-specific events (optional)

Parameters
eventPlatform-specific event data (e.g., SDL_Event*)
Todo:
Handle gamepad events

Implements yaze::emu::input::IInputBackend.

Definition at line 104 of file input_backend.cc.

References initialized_, and UpdateEventState().

Here is the call graph for this function:

◆ GetConfig()

InputConfig yaze::emu::input::SDL2InputBackend::GetConfig ( ) const
inlineoverridevirtual

Get current configuration.

Implements yaze::emu::input::IInputBackend.

Definition at line 119 of file input_backend.cc.

References config_.

◆ SetConfig()

void yaze::emu::input::SDL2InputBackend::SetConfig ( const InputConfig config)
inlineoverridevirtual

Update configuration (hot-reload)

Implements yaze::emu::input::IInputBackend.

Definition at line 121 of file input_backend.cc.

References config_.

◆ GetBackendName()

std::string yaze::emu::input::SDL2InputBackend::GetBackendName ( ) const
inlineoverridevirtual

Get backend name for debugging.

Implements yaze::emu::input::IInputBackend.

Definition at line 125 of file input_backend.cc.

◆ IsInitialized()

bool yaze::emu::input::SDL2InputBackend::IsInitialized ( ) const
inlineoverridevirtual

Check if backend is initialized.

Implements yaze::emu::input::IInputBackend.

Definition at line 127 of file input_backend.cc.

References initialized_.

◆ UpdateEventState()

Member Data Documentation

◆ config_

InputConfig yaze::emu::input::SDL2InputBackend::config_
private

Definition at line 146 of file input_backend.cc.

Referenced by GetConfig(), Initialize(), Poll(), SetConfig(), and UpdateEventState().

◆ initialized_

bool yaze::emu::input::SDL2InputBackend::initialized_ = false
private

Definition at line 147 of file input_backend.cc.

Referenced by Initialize(), IsInitialized(), Poll(), ProcessEvent(), and Shutdown().

◆ event_state_

ControllerState yaze::emu::input::SDL2InputBackend::event_state_
private

Definition at line 148 of file input_backend.cc.

Referenced by Poll(), and UpdateEventState().


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