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>
6
7namespace yaze {
8namespace emu {
9
10// Forward declaration
11class Snes;
12
13namespace input {
14
16 public:
17 InputManager() = default;
19
21 void Initialize(std::unique_ptr<IInputBackend> backend);
22 void Shutdown();
23 void Poll(Snes* snes, int player = 1);
24 void ProcessEvent(void* event);
25
26 IInputBackend* backend() { return backend_.get(); }
27 const IInputBackend* backend() const { return backend_.get(); }
28
29 bool IsInitialized() const { return backend_ && backend_->IsInitialized(); }
30
31 InputConfig GetConfig() const;
32 void SetConfig(const InputConfig& config);
33
34 // --- Agent Control API ---
35 void PressButton(SnesButton button);
36 void ReleaseButton(SnesButton button);
37
38 private:
39 std::unique_ptr<IInputBackend> backend_;
40 ControllerState agent_controller_state_; // State controlled by agent
41};
42
43} // namespace input
44} // namespace emu
45} // namespace yaze
46
47#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)
Main namespace for the application.
Controller state (16-bit SNES controller format)
Input configuration (platform-agnostic key codes)