mirror of
https://github.com/glfw/glfw.git
synced 2025-07-27 01:50:02 +00:00
Fix joystick callback when it's already connected on app start
This commit is contained in:
parent
d11cb3779b
commit
ee38126be5
@ -1261,11 +1261,8 @@ GLFWAPI void* glfwGetJoystickUserPointer(int jid)
|
|||||||
GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun)
|
GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun)
|
||||||
{
|
{
|
||||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||||
|
|
||||||
if (!initJoysticks())
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
_GLFW_SWAP(GLFWjoystickfun, _glfw.callbacks.joystick, cbfun);
|
_GLFW_SWAP(GLFWjoystickfun, _glfw.callbacks.joystick, cbfun);
|
||||||
|
initJoysticks();
|
||||||
return cbfun;
|
return cbfun;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user