-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add SDL input samples #106
Conversation
I recommend delaying this until the SDL work has landed (and this commit was rebased). I'd rather have a non-bisectable commit in a submodule than in nxdk. |
24d659c
to
767b119
Compare
bb1a366
to
8d25562
Compare
61a474f
to
a0f35be
Compare
SDL_QuitSubSystem(SDL_INIT_JOYSTICK); | ||
XSleep(2000); | ||
pb_kill(); | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this breaks, it will run the same deinit code again outside of the main-loop.
If you don't break, you probably still want to close the joy
joystick.
int ret = pb_init(); | ||
if (ret != 0) { | ||
XSleep(2000); | ||
return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Negative numbers returned from main are very uncommon.
SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER); | ||
XSleep(2000); | ||
pb_kill(); | ||
return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See same comment in joystick sample about de-init after main-loop and closing of gameController
.
while (true) { | ||
// Fetch current GameController state | ||
SDL_GameControllerUpdate(); | ||
debugClearScreen(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing review comments, about checking wether gameController
is still connected, seem to have been ignored / missed.
Shall we:
..or..
|
I'll pull the trigger on closing unless someone objects. |
Closed as my design was bad and my implementation of this bad design was even worse. 👍 |
Samples which requires XboxDev/nxdk-sdl#5.