Skip to content
Snippets Groups Projects
Commit e43bb19e authored by Robert Menzel's avatar Robert Menzel
Browse files

fixed gamepad bugs

parent 6aa1be2a
No related branches found
No related tags found
No related merge requests found
......@@ -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] << " ";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment