yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
input_manager.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EMU_INPUT_INPUT_MANAGER_H_
2#define YAZE_APP_EMU_INPUT_INPUT_MANAGER_H_
3
4#include <memory>
5
7
8namespace yaze {
9namespace emu {
10
11// Forward declaration
12class Snes;
13
14namespace input {
15
17 public:
20
23 void Initialize(std::unique_ptr<IInputBackend> backend);
24 void Shutdown();
25 void Poll(Snes* snes, int player = 1);
26 void ProcessEvent(void* event);
27
28 IInputBackend* backend() { return backend_.get(); }
29 const IInputBackend* backend() const { return backend_.get(); }
30
31 bool IsInitialized() const { return backend_ && backend_->IsInitialized(); }
32
33 InputConfig GetConfig() const;
34 void SetConfig(const InputConfig& config);
35
36 // --- Agent Control API ---
37 void PressButton(SnesButton button);
38 void ReleaseButton(SnesButton button);
39
40 private:
41 std::unique_ptr<IInputBackend> backend_;
42 ControllerState agent_controller_state_; // State controlled by agent
43 InputConfig config_; // Cached/pending config
44};
45
46} // namespace input
47} // namespace emu
48} // namespace yaze
49
50#endif // YAZE_APP_EMU_INPUT_INPUT_MANAGER_H_
Abstract input backend interface.
void Poll(Snes *snes, int player=1)
void PressButton(SnesButton button)
std::unique_ptr< IInputBackend > backend_
ControllerState agent_controller_state_
void SetConfig(const InputConfig &config)
void ReleaseButton(SnesButton button)
InputConfig GetConfig() const
const IInputBackend * backend() const
bool Initialize(InputBackendFactory::BackendType type=InputBackendFactory::BackendType::SDL2)
SnesButton
SNES controller button mapping (platform-agnostic)
Controller state (16-bit SNES controller format)
Input configuration (platform-agnostic key codes)