mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 14:24:35 +00:00
Fixed joystick state not being initialized.
This commit is contained in:
parent
aa3364a73e
commit
296632c8d2
@ -80,8 +80,8 @@ static int openJoystickDevice(int joy, const char* path)
|
|||||||
ioctl(fd, JSIOCGBUTTONS, &numButtons);
|
ioctl(fd, JSIOCGBUTTONS, &numButtons);
|
||||||
_glfw.x11.joystick[joy].numButtons = (int) numButtons;
|
_glfw.x11.joystick[joy].numButtons = (int) numButtons;
|
||||||
|
|
||||||
_glfw.x11.joystick[joy].axis = (float*) malloc(sizeof(float) * numAxes);
|
_glfw.x11.joystick[joy].axis = (float*) calloc(numAxes, sizeof(float));
|
||||||
_glfw.x11.joystick[joy].button = (unsigned char*) malloc(numButtons);
|
_glfw.x11.joystick[joy].button = (unsigned char*) calloc(numButtons, 1);
|
||||||
|
|
||||||
_glfw.x11.joystick[joy].present = GL_TRUE;
|
_glfw.x11.joystick[joy].present = GL_TRUE;
|
||||||
#endif // __linux__
|
#endif // __linux__
|
||||||
|
Loading…
Reference in New Issue
Block a user