Skip to content

fix(sdl2): use SDL_WINDOW_FULLSCREEN_DESKTOP and reset windowed mode - #285

Open
pinklightultra wants to merge 1 commit into
djdiskmachine:masterfrom
pinklightultra:fix/sdl2-fullscreen-desktop
Open

pinklightultra wants to merge 1 commit into
djdiskmachine:masterfrom
pinklightultra:fix/sdl2-fullscreen-desktop

Conversation

@pinklightultra

@pinklightultra pinklightultra commented Oct 15, 2026 •

Copy link
Copy Markdown

Description

Fixes fullscreen mode when running the SDL2 driver on modern desktop displays and handhelds (e.g. ASUS ROG Ally, Windows 11 high-DPI/1080p displays):

  1. Resolution Calculation: Sets windowed_ = false; when FULLSCREEN is configured to "YES", ensuring screenRect_ calculates against native display bounds (screenWidth, screenHeight) rather than scaled window dimensions (appWidth * mult_).
  2. Seamless Fullscreen: Uses SDL_WINDOW_FULLSCREEN_DESKTOP instead of SDL_WINDOW_FULLSCREEN in SDL_CreateWindow to avoid disruptive hardware display mode switches, prevent window scaling artifacts, and scale cleanly to desktop bounds with correct aspect centering.
  3. Rebased & Clang-formatted: Rebased cleanly on top of latest master (resolving conflict with PR Fix text background #284) with strict clang-format compliance across all modified lines.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Verified on Windows 11 x64 and handheld PC (ASUS ROG Ally):

  1. Configure FULLSCREEN=YES in config.xml.
  2. Launch lgpt.exe using the SDL2 backend.
  3. Verified the window launches directly into fullscreen desktop resolution without mode switching, display stretching, or black borders on native 16:9 / 1080p displays.
  4. Verified that toggling between windowed and fullscreen retains proper aspect-ratio centering.
  5. Verified line-by-line clang-format compliance against repository LLVM style.

Test Configuration:

  • Hardware: Windows 11 Desktop (1080p / 1440p) & ASUS ROG Ally Handheld (1080p)
  • Backend: SDL2
  • Test steps: Launched with FULLSCREEN=YES and FULLSCREEN=NO to verify window sizing and fullscreen scaling.

Checklist:

  • I have performed a self-review of my code
  • I have commented particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Changes are line-by-line clang-format compliant

@djdiskmachine

Copy link
Copy Markdown
Owner

Looks interesting!
How have you verified it?
Please have a look at the pr template and add some more info.

@pinklightultra

Copy link
Copy Markdown
Author

It ran on my windows machine. this was just a proposed fix for issues I had for my Xbox rog ally but I wanted to help share it

@pinklightultra
pinklightultra force-pushed the fix/sdl2-fullscreen-desktop branch from beee5bc to a0d615b Compare October 25, 2026 20:23
@pinklightultra

Copy link
Copy Markdown
Author

Rebased onto latest master (resolving the merge conflict with #284) and verified line-by-line clang-format compliance against the repo's style guidelines. I have also updated the PR description above with the official template, test configuration (Windows 11 & ROG Ally), and verification steps.

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