mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 08:50:15 +00:00
Make joystick platform code init on demand
This makes joystick support initialize the first time a joystick function is called, including those gamepad functions that are layered on top of joystick functions. Related to #1284. Related to #1646.
This commit is contained in:
@@ -493,7 +493,7 @@ static BOOL CALLBACK deviceCallback(const DIDEVICEINSTANCE* di, void* user)
|
||||
|
||||
// Initialize joystick interface
|
||||
//
|
||||
void _glfwInitJoysticksWin32(void)
|
||||
GLFWbool _glfwPlatformInitJoysticks(void)
|
||||
{
|
||||
if (_glfw.win32.dinput8.instance)
|
||||
{
|
||||
@@ -505,15 +505,17 @@ void _glfwInitJoysticksWin32(void)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Win32: Failed to create interface");
|
||||
return GLFW_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
_glfwDetectJoystickConnectionWin32();
|
||||
return GLFW_TRUE;
|
||||
}
|
||||
|
||||
// Close all opened joystick handles
|
||||
//
|
||||
void _glfwTerminateJoysticksWin32(void)
|
||||
void _glfwPlatformTerminateJoysticks(void)
|
||||
{
|
||||
int jid;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user