mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 09:40:06 +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 dinput_init_context(void)
|
||||||
{
|
{
|
||||||
|
bool context_initialized = false;
|
||||||
if (g_dinput_ctx)
|
if (g_dinput_ctx)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -96,20 +97,23 @@ bool dinput_init_context(void)
|
|||||||
|
|
||||||
/* Who said we shouldn't have same call signature in a COM API? <_< */
|
/* Who said we shouldn't have same call signature in a COM API? <_< */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
if (FAILED(DirectInput8Create(
|
context_initialized = (SUCCEEDED(DirectInput8Create(
|
||||||
GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8,
|
GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8,
|
||||||
(void**)&g_dinput_ctx, NULL)))
|
(void**)&g_dinput_ctx, NULL)));
|
||||||
#else
|
#else
|
||||||
if (FAILED(DirectInput8Create(
|
context_initialized = (SUCCEEDED(DirectInput8Create(
|
||||||
GetModuleHandle(NULL), DIRECTINPUT_VERSION, &IID_IDirectInput8,
|
GetModuleHandle(NULL), DIRECTINPUT_VERSION, &IID_IDirectInput8,
|
||||||
(void**)&g_dinput_ctx, NULL)))
|
(void**)&g_dinput_ctx, NULL)));
|
||||||
#endif
|
#endif
|
||||||
{
|
|
||||||
RARCH_ERR("Failed to init DirectInput.\n");
|
if (!context_succeeded)
|
||||||
return false;
|
goto error;
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
error:
|
||||||
|
RARCH_ERR("Failed to initialize DirectInput.\n");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *dinput_init(void)
|
static void *dinput_init(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user