-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGamepadBindingCollection.h
28 lines (20 loc) · 1 KB
/
GamepadBindingCollection.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
#include <SDL2/SDL_gamecontroller.h>
#include "InputLibraryDefine.h"
#include "Types.h"
class GamepadBindingCollection {
public:
INPUT_API GamepadBindingCollection();
INPUT_API ~GamepadBindingCollection();
INPUT_API bool AddMappingWithName( const rString& keyName, ActionIdentifier action, bool overwrite = false,
bool clearConflicting = false, rString* errorString = nullptr );
INPUT_API bool AddMappingWithButton( SDL_GameControllerButton button, ActionIdentifier action, bool overwrite = false,
bool clearConflicting = false, rString* errorString = nullptr );
INPUT_API bool BindAction( ActionIdentifier action, SDL_GameControllerButton button, bool overwrite );
INPUT_API SDL_GameControllerButton GetButtonFromAction( ActionIdentifier action ) const;
private:
void FillTheVoid( ActionIdentifier action );
rMap<SDL_GameControllerButton, ActionIdentifier> m_ButtonToAction;
rVector<SDL_GameControllerButton> m_ActionToButton;
static const size_t mc_OverflowLimit = 200;
};