Fixed joystick state not being initialized.

This commit is contained in:
Camilla Berglund 2013-04-30 17:03:09 +02:00
parent aa3364a73e
commit 296632c8d2

View File

@ -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__