mirror of
https://github.com/borgesdan/xn65
synced 2024-12-29 21:54:47 +01:00
Corrige GamePad
This commit is contained in:
parent
80ff2d2fe5
commit
507e61c95b
@ -41,23 +41,22 @@ namespace xna {
|
||||
}
|
||||
|
||||
void Game::Initialize() {
|
||||
Keyboard::Initialize();
|
||||
Mouse::Initialize();
|
||||
GamePad::Initialize();
|
||||
|
||||
#if (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/)
|
||||
//#if (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/)
|
||||
Microsoft::WRL::Wrappers::RoInitializeWrapper initialize(RO_INIT_MULTITHREADED);
|
||||
if (FAILED(initialize))
|
||||
{
|
||||
MessageBox(nullptr, "Ocorreu um erro ao chamar Microsoft::WRL::Wrappers::RoInitializeWrapper.", "XN65", MB_OK);
|
||||
}
|
||||
#else
|
||||
//#else
|
||||
HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
MessageBox(nullptr, "Ocorreu um erro ao chamar CoInitializeEx.", "XN65", MB_OK);
|
||||
}
|
||||
#endif
|
||||
//#endif
|
||||
Keyboard::Initialize();
|
||||
Mouse::Initialize();
|
||||
GamePad::Initialize();
|
||||
|
||||
_audioEngine = New<AudioEngine>();
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
namespace xna {
|
||||
void GamePad::Initialize() {
|
||||
impl = uNew<PlatformImplementation>();
|
||||
impl->_dxGamePad = uNew<DirectX::GamePad>();
|
||||
impl->_dxGamePad = uNew<DirectX::GamePad>();
|
||||
}
|
||||
|
||||
GamePadState GamePad::GetState(PlayerIndex index) {
|
||||
|
@ -141,13 +141,6 @@ namespace xna {
|
||||
};
|
||||
|
||||
struct GamePad::PlatformImplementation {
|
||||
~PlatformImplementation() {
|
||||
if (_dxGamePad) {
|
||||
_dxGamePad->Suspend();
|
||||
_dxGamePad = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
inline static uptr<DirectX::GamePad> _dxGamePad = nullptr;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user