Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ACGL
acgl
Commits
e43bb19e
Commit
e43bb19e
authored
Aug 12, 2013
by
Robert Menzel
Browse files
fixed gamepad bugs
parent
6aa1be2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ACGL/HardwareSupport/GamePad.cc
View file @
e43bb19e
...
...
@@ -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.0
f
;
}
*/
}
#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
]
<<
" "
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment