Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gamepad_only_once_per_frame #4292

Merged
merged 2 commits into from
May 6, 2016

Conversation

juj
Copy link
Collaborator

@juj juj commented May 5, 2016

Only poll gamepad api once per application frame in order to be safe if subsequent polls might change the data under the hood, which might lead to missing button events if they are buffered. See w3c/gamepad#22. Also reduces the amount of garbage that is generated, and the number of times we jump to a call inside the browser if application iterates through multiple gamepads per frame.

…if subsequent polls might change the data under the hood, which might lead to missing button events if they are buffered. See w3c/gamepad#22. Also reduces the amount of garbage that is generated, and the number of times we jump to a call inside the browser if application iterates through multiple gamepads per frame.
@juj juj added the HTML5 API label May 5, 2016
@kripken
Copy link
Member

kripken commented May 5, 2016

lgtm

@juj juj merged commit c12215c into emscripten-core:incoming May 6, 2016
@juj juj mentioned this pull request May 3, 2017
12 tasks
satoshinm added a commit to satoshinm/emscripten that referenced this pull request May 6, 2017
…-coreGH-4292

Joystick connected/disconnected callbacks are also now called in
refreshJoysticks(). The gamepadconnected/disconnected events are only
used as a hint to refresh the joysticks, whose getGamepads() state is
compared to the previous state to determine the new state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants