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() {
|
2024-06-22 11:52:21 -03:00
|
|
|
impl = unew<PlatformImplementation>();
|
2024-08-01 11:18:07 -03:00
|
|
|
}
|
2024-04-24 11:44:41 -03:00
|
|
|
}
|