libs/sdl: build on Android / GL ES (glColorMaski stub + SDL_SetMainReady)#952
Open
Pign wants to merge 2 commits into
Open
libs/sdl: build on Android / GL ES (glColorMaski stub + SDL_SetMainReady)#952Pign wants to merge 2 commits into
Pign wants to merge 2 commits into
Conversation
…p the SDL_main check
A pure HL binary (./hl my.hl from adb shell) is not wrapped in an
Android Activity, so SDL2's Android backend refuses SDL_Init with
"Application didn't initialize properly, did you include SDL_main.h".
Calling SDL_SetMainReady() under #ifdef __ANDROID__ before SDL_Init
tells SDL the main entry is already set up, letting headless tests
proceed at least through SDL_Init. (Actually opening a Window /
GL context still requires an Activity surface, which adb shell
can't provide — that's an Android-app-side concern.)
Android arm64 validation against the latest JIT (8 hand-written
plus Heaps math/transform):
nullbool.hl EXIT=0 (Null<Bool> compare via dyn_compare)
streq2.hl EXIT=0 (String compare via hl_dyn_compare)
big.hl EXIT=0 (qsort + memo + structs + Math)
calc.hl EXIT=109 = fib(20) % 256
heapnowin.hl EXIT=32 = h3d.Vector dot product
+ h3d.Matrix rotation transform
The JIT itself is fully working on Android arm64. The only missing
piece for visual Heaps demos is the Android-app wrapper (APK with
SDL2 Activity glue), which is out of scope for the JIT port.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
GL ES has no per-MRT colour-mask. Stub it to ES_NOT_SUPPORTED so the gl.c HL bindings compile on Android arm64 without pulling the desktop GL pipeline state.
ffa1ce7 to
de3a57a
Compare
Contributor
Author
|
Fixed the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small fixes to build the SDL/GL bindings on Android arm64 (GL ES):
gl.c: stubglColorMaskitoES_NOT_SUPPORTED— GL ES has no per-MRT colour mask, so the call can't be expressed there. Keeps the desktop path untouched.sdl.c: callSDL_SetMainReady()under#ifdef __ANDROID__beforeSDL_Init, so a pure HL/native binary (not wrapped in an Android Activity) doesn't trip SDL'sSDL_maincheck.Both are guarded by GL ES /
__ANDROID__and have no effect on desktop targets. Rebased onto the current SDL3 master.