mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-24 03:36:24 +00:00
Backport/rewrites wmarquesr - pt. 4
This commit is contained in:
parent
be971fc258
commit
a53334fba6
@ -89,6 +89,7 @@ void dinput_destroy_context(void)
|
||||
|
||||
bool dinput_init_context(void)
|
||||
{
|
||||
bool context_initialized = false;
|
||||
if (g_dinput_ctx)
|
||||
return true;
|
||||
|
||||
@ -96,20 +97,23 @@ bool dinput_init_context(void)
|
||||
|
||||
/* Who said we shouldn't have same call signature in a COM API? <_< */
|
||||
#ifdef __cplusplus
|
||||
if (FAILED(DirectInput8Create(
|
||||
context_initialized = (SUCCEEDED(DirectInput8Create(
|
||||
GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8,
|
||||
(void**)&g_dinput_ctx, NULL)))
|
||||
(void**)&g_dinput_ctx, NULL)));
|
||||
#else
|
||||
if (FAILED(DirectInput8Create(
|
||||
context_initialized = (SUCCEEDED(DirectInput8Create(
|
||||
GetModuleHandle(NULL), DIRECTINPUT_VERSION, &IID_IDirectInput8,
|
||||
(void**)&g_dinput_ctx, NULL)))
|
||||
(void**)&g_dinput_ctx, NULL)));
|
||||
#endif
|
||||
{
|
||||
RARCH_ERR("Failed to init DirectInput.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!context_succeeded)
|
||||
goto error;
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
RARCH_ERR("Failed to initialize DirectInput.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
static void *dinput_init(void)
|
||||
|
Loading…
Reference in New Issue
Block a user