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

[SDL2][PSP] Allow to use ShowMessageBox without window #10580

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

fjtrujy
Copy link
Contributor

@fjtrujy fjtrujy commented Aug 22, 2024

Description

This PR allows to show message box even if there are no windows created.
In order to make this work we are now creating a temporal GU context if there is no window created.

Some other changes have been done:

  • Unify constants on src/render/psp/SDL_render_psp.h
  • Move SDL_pspmessagebox implementation to SDL_pspvideo.c
  • Reduced the size of the GU list.
  • Some other minor changes

The test/testmessage.c example works as expected now.

Screenshot 2024-08-22 at 18 10 23 Screenshot 2024-08-22 at 18 10 29 Screenshot 2024-08-22 at 18 10 35 Screenshot 2024-08-22 at 18 10 41 Screenshot 2024-08-22 at 18 10 46 Screenshot 2024-08-22 at 18 10 50 Screenshot 2024-08-22 at 18 10 55 Screenshot 2024-08-22 at 18 11 00 Screenshot 2024-08-22 at 18 11 05 Screenshot 2024-08-22 at 18 11 10

@fjtrujy
Copy link
Contributor Author

fjtrujy commented Aug 22, 2024

Pinging @erysdren as he was original MessageBox implementation

@fjtrujy fjtrujy force-pushed the psp/sdl2ShowMessageNoWindow branch from 1f034f9 to 7543a6f Compare August 22, 2024 17:15
@fjtrujy
Copy link
Contributor Author

fjtrujy commented Aug 23, 2024

I have also tested it in real PSP hardware and there everything worked fine, even the wrong unicode text we can see in the previous screenshots from PPSSPP.

Cheers

@fjtrujy
Copy link
Contributor Author

fjtrujy commented Aug 23, 2024

@slouken feel free to merge this PR!

@slouken slouken merged commit 1b8d563 into libsdl-org:SDL2 Aug 23, 2024
40 checks passed
@slouken
Copy link
Collaborator

slouken commented Aug 23, 2024

Merged!

@fjtrujy fjtrujy deleted the psp/sdl2ShowMessageNoWindow branch August 23, 2024 21:15
@ledow
Copy link

ledow commented Sep 21, 2024

Can this work on other platforms? SDL2 MessageBoxes on Steam Deck (when running as a Windows executable) don't appear for me and I haven't got to the bottom of why (running with just SDL_WINDOW_SHOWN) flag on the window.

@slouken
Copy link
Collaborator

slouken commented Sep 26, 2024

Have you already done similar work for SDL3?

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.

3 participants