1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00
xn65/sources/framework-dx/keyboard.cpp

18 lines
439 B
C++
Raw Permalink Normal View History

2024-09-06 22:23:32 -03:00
#include "xna-dx/framework.hpp"
2024-04-24 11:44:41 -03:00
namespace xna {
2024-05-21 17:24:43 -03:00
KeyboardState Keyboard::GetState() {
2024-05-21 20:43:37 -03:00
if (!impl || !impl->_dxKeyboard)
2024-05-21 17:24:43 -03:00
return KeyboardState();
2024-04-24 11:44:41 -03:00
2024-05-21 17:24:43 -03:00
const auto state = Keyboard::impl->_dxKeyboard->GetState();
auto ptr = reinterpret_cast<const uint32_t*>(&state);
const auto xnaState = reinterpret_cast<const KeyboardState*>(ptr);
return *xnaState;
}
void Keyboard::Initialize() {
impl = unew<PlatformImplementation>();
2024-08-01 11:18:07 -03:00
}
2024-04-24 11:44:41 -03:00
}