mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2025-02-16 03:39:56 -05:00
Fixed crash when xinput is not present.
This commit is contained in:
parent
dd68d9d909
commit
3de8b63457
1 changed files with 15 additions and 1 deletions
|
@ -79,12 +79,21 @@ namespace entry
|
|||
{
|
||||
XInputGetState = (PFN_XINPUT_GET_STATE)bx::dlsym(m_xinputdll, "XInputGetState");
|
||||
// XInputEnable = (PFN_XINPUT_ENABLE )bx::dlsym(m_xinputdll, "XInputEnable" );
|
||||
|
||||
if (NULL == XInputGetState)
|
||||
{
|
||||
shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void shutdown()
|
||||
{
|
||||
bx::dlclose(m_xinputdll);
|
||||
if (NULL != m_xinputdll)
|
||||
{
|
||||
bx::dlclose(m_xinputdll);
|
||||
m_xinputdll = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool filter(GamepadAxis::Enum _axis, int32_t _old, int32_t* _value)
|
||||
|
@ -98,6 +107,11 @@ namespace entry
|
|||
|
||||
void update(EventQueue& _eventQueue)
|
||||
{
|
||||
if (NULL == m_xinputdll)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
WindowHandle defaultWindow = { 0 };
|
||||
GamepadHandle handle = { 0 };
|
||||
|
||||
|
|
Loading…
Reference in a new issue