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

Warn user about SDL initialization failure #568

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hitomi-nakayama
Copy link

On my system, I had issues with SameBoy detecting my controller, though sound and graphics were working.
It turns out that it was because SDL_Init was silently failing, as my system's SDL was compiled without support for haptics.
(My Gentoo Linux system's libsdl2 was built without the haptic USE flag. After re-installing with the haptic flag enabled, my controller worked.)

This patch will now give the user this warning: Couldn't initialize SDL: SDL not built with haptic (force feedback) support.

@hitomi-nakayama
Copy link
Author

This may not be the best solution to the overall issue.

We could additionally warn the user that the lack of haptics support may lead to no controller functionality.
Alternatively, we can conditionally enable haptics support for SameBoy compilation, so that SDL initialization will not fail on these systems.

@ISSOtm
Copy link
Contributor

ISSOtm commented Jun 15, 2024

Perhaps it may be more useful to call SDL_InitSubSystem for each thing we want to init, and report errors for each. The increased granularity then would make the error messages more useful.

The questions then are:

  • Would @LIJI32 accept that? It's a bit more code than there currently is.
  • How should the errors be reported? Printed to the console, SDL_ShowSimpleMessageBox, both?
  • Which subsystems do we want to init?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants