0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-12 15:53:42 +00:00
SDL_Minigame/include/InputComponent.h
Sara Varga cefa1c2e29 added InputSystemComponent
needs testing
2024-06-21 22:47:36 +02:00

26 lines
422 B
C++

#pragma once
#include <SDL.h>
#include <map>
#include "Component.h"
#include "Key.h"
class InputComponent : public Component
{
public:
InputComponent();
~InputComponent();
void init() override;
void update() override;
bool isKeyDown(Key key);
private:
const Uint8* m_keyStates;
SDL_Scancode mapKeyToSDL(Key key);
std::map<Key, SDL_Scancode> m_keyMappings;
void InitKeyMappings();
};