mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 12:09:36 +00:00
Add FreeType, progress to title screen
This commit is contained in:
44
PortabilityLayer/InputManager.cpp
Normal file
44
PortabilityLayer/InputManager.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
#include "InputManager.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class InputManagerImpl final : public InputManager
|
||||
{
|
||||
public:
|
||||
InputManagerImpl();
|
||||
|
||||
void GetKeys(unsigned char *keys16) const override;
|
||||
|
||||
static InputManagerImpl *GetInstance();
|
||||
|
||||
private:
|
||||
unsigned char m_keys[16];
|
||||
|
||||
static InputManagerImpl ms_instance;
|
||||
};
|
||||
|
||||
void InputManagerImpl::GetKeys(unsigned char *keys16) const
|
||||
{
|
||||
memcpy(keys16, m_keys, 16);
|
||||
}
|
||||
|
||||
InputManagerImpl *InputManagerImpl::GetInstance()
|
||||
{
|
||||
return &ms_instance;
|
||||
}
|
||||
|
||||
InputManagerImpl::InputManagerImpl()
|
||||
{
|
||||
for (int i = 0; i < sizeof(m_keys) / sizeof(m_keys[0]); i++)
|
||||
m_keys[i] = 0;
|
||||
}
|
||||
|
||||
InputManagerImpl InputManagerImpl::ms_instance;
|
||||
|
||||
InputManager *InputManager::GetInstance()
|
||||
{
|
||||
return InputManagerImpl::GetInstance();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user