Skip to content

SDL3: Make it the default, further Emscripten & Android fixes#3543

Open
Ghabry wants to merge 15 commits into
EasyRPG:masterfrom
Ghabry:sdl3
Open

SDL3: Make it the default, further Emscripten & Android fixes#3543
Ghabry wants to merge 15 commits into
EasyRPG:masterfrom
Ghabry:sdl3

Conversation

@Ghabry
Copy link
Copy Markdown
Member

@Ghabry Ghabry commented May 8, 2026

Draft as the Android fixes are missing cough - working on it.

Though already good enough for testing Emscripten and other platforms if anything breaks.

Ghabry added 11 commits May 8, 2026 17:20
Bump required version to 3.4.0.
That version added some features which will be required for the GPU renderer.
Guess they are not required anymore?
…iting it

This appears to be a regression (reported as SDL#15502)
Otherwise the Window is a blurry mess on 4k displays, at least on Linux
…wn which corrupts memory

This can happen when the system graphic is invalid, as ResetGameObjects will init the data structures again

Another issue with our fragile shutdown system :(
…s unncessary

There also seems to be a codegen bug. Invoking of some constructors on shutdown results in "function signature mismatch". This prevents the global constructors to be called at the end.

Manually invoke our onExit handler instead.

Removed the extern from main as this emitted a warning

Fix EasyRPG#3464
@Ghabry Ghabry added this to the 0.8.2 milestone May 8, 2026
@github-actions github-actions Bot added Building Emscripten WebAssembly/JavaScript port for web browsers Settings All about customizable features, storing and applying them labels May 8, 2026
@Ghabry Ghabry removed the Building label May 8, 2026
@Ghabry
Copy link
Copy Markdown
Member Author

Ghabry commented May 8, 2026

guess for the github runners I have to set them to SDL2.

Looking at repology the first Debian/Ubuntu with a new enough SDL3 (3.4) are Debian 14 and Ubuntu 26.04 😅

cfg.renderer.Lock("SDL3 (Software, Emscripten)");
#elif defined(__wii__)
cfg.renderer.Lock("SDL2 (Software, Wii)");
cfg.renderer.Lock("SDL3 (Software, Wii)");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the Wii (U) stuff here is not needed the next 10 years^^

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably :D. If you want I can remove this for now.

Not really working.

The second time a game starts it reports SIGSEGV and I cannot figure out the reason because the debugger does not catch the signal.
@Ghabry
Copy link
Copy Markdown
Member Author

Ghabry commented May 15, 2026

Figured out the Android crash with AI assistance... I noticed that it isn't really crashing, just terminating. So I dumped the Activity Stack and noticed that after the first game shutdown the Activity Stack is empty (no GameBrowser).

Feeded this information into Gemini and the answer was that I must set SDL_ANDROID_ALLOW_RECREATE_ACTIVITY=1 to prevent SDL from calling System.exit().

Yeah that is a new SDL3 feature to get a clean environment on every restart. Disabling this behaviour indeed fixes the "crash" and it runs fine.

Ghabry added 2 commits May 15, 2026 15:38
… terminating the app

We support restarting from the Game Browser so this restores the old SDL2 behaviour and makes everything work as expected.
The versions we build on have no or outdated (<3.4) SDL3 versions
@Ghabry
Copy link
Copy Markdown
Member Author

Ghabry commented May 15, 2026

Also updated the bounding box calculation of the game window so it's possible now to create Portrait Mode games :D.

(I remember a user telling us this didn't work a while ago)

Screenshot_2026-05-15-15-57-15-588_org easyrpg player

Is more reliable and allows custom aspect ratios e.g. portrait mode games.
@Ghabry
Copy link
Copy Markdown
Member Author

Ghabry commented May 15, 2026

Everything should work now at least not worse than with SDL2 :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Android Building Emscripten WebAssembly/JavaScript port for web browsers FileFinder Settings All about customizable features, storing and applying them

Development

Successfully merging this pull request may close these issues.

2 participants