Commit e43bb19e authored by Robert Menzel's avatar Robert Menzel

fixed gamepad bugs

parent 6aa1be2a
......@@ -240,8 +240,8 @@ void GamePad::getAxisAndButtonValues()
#ifdef ACGL_COMPILE_WITH_GLFW
mGLFWButtons = glfwGetJoystickButtons( mGLFWGamePadNumber, &mNumberOfButtons );
mGLFWAxes = glfwGetJoystickAxes( mGLFWGamePadNumber, &mNumberOfAxes );
memcpy( mButtonState, mGLFWButtons, mNumberOfButtons*sizeof(float) );
memcpy( mAxes, mGLFWAxes, mNumberOfAxes );
memcpy( mButtonState, mGLFWButtons, mNumberOfButtons );
memcpy( mAxes, mGLFWAxes, mNumberOfAxes * sizeof(float) );
#elif defined( ACGL_OWN_LINUX_JOYSTICK )
EventJoystick event;
......@@ -268,7 +268,7 @@ void GamePad::getAxisAndButtonValues()
}
for (int i = 0; i < mNumberOfAxes; ++i) {
mAxes[i] = 0.0f;
}*/
}
#endif
}
......@@ -327,6 +327,11 @@ void GamePad::printState()
return;
}
if (!mLastButtonState) {
// uninitialized, update() will initialize the buttons
update();
}
for (int i = 0; i < mNumberOfButtons; ++i) {
debug() << (int) mButtonState[i] << " ";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment