Skip to content

Front ends: an app that hosts the game view can draw the prepare step's progress itself - #742

Closed
v0lumehi wants to merge 1 commit into
seedds:mainfrom
v0lumehi:front-progress-hook
Closed

v0lumehi wants to merge 1 commit into
seedds:mainfrom
v0lumehi:front-progress-hook

Conversation

@v0lumehi

Copy link
Copy Markdown
Contributor

What and why

A launcher that holds several games in one iOS app (route C in the NX2Apple fork: one shell app, each game's modules in its own framework, the shell hosts the engine and front_ios.m's game view) wants the first-start "Preparing shaders" step to look like the rest of its UI instead of the front end's dark UIKit screen.

This adds one optional hook in front.h:

extern void (*front_progress_hook)(const char *title, long done, long total);

Set before the game starts, it receives every front_progress call's values on the front end's main thread (title NULL when the step ends), and the front end then shows no screen of its own. It is NULL by default, so the per-game iOS app and the Mac app keep their current progress screens exactly as they are: the default path is unchanged. Both front ends (front_ios.m, front_mac.m) define it, so a host app on either platform can use it.

Checked

  • Builds: dm/ios/tools/compile_check.py with GAME=010015100B514000 (183 files, 0 failed) and make -C dm/host GAME=010015100B514000 dmhost on the Mac.
  • No Python changed, so lint_python.py has nothing new to check. No test covers the front ends' progress screen, and none is added: with the hook unset the code path is the old one.
  • Games run: the default path is unchanged and was not re-run for this change. The hook's user is the fork's shell app (iOS shell: art-led library, Cover Flow, settings and the host layer for iPhone and iPad LNPANDY/NX2Apple#226), where Breath of the Wild (01007EF00011E000, 1.9.0) boots from its framework on an iPhone 17 Pro Max, iOS 27.0.1.
  • scripts/regress.py: not run, the change only adds an unset hook to the two front ends.

Docs

  • No game files, keys or data extracted from a game in the change or the attachments

…'s progress itself

front_progress_hook (front.h): set before the game starts, it gets every front_progress call's title, done and total on the front
end's main thread, and the front end shows no progress screen of its own. NULL by default, so the Mac app and the iOS app keep
their screens exactly as they are. A launcher that holds several games in one app draws the step in its own look.
seedds added a commit that referenced this pull request Nov 2, 2026
…'s progress itself (#742)

front_progress_hook (front.h): set before the game starts, with a window it gets each front_progress
call's title, done and total on the front end's main thread, and the front end shows no progress
screen of its own. NULL by default, so the Mac app and the iOS app keep their screens as they are.
A launcher that holds several games in one app draws the step in its own look. docs/frontends.md
lists it in a new section for apps that host the engine in-process.

Co-authored-by: v0lumehi <[email protected]>
@seedds

seedds commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Thanks. Landed as fa4c356, with you as co-author. The code is as you wrote it. Two additions: the comment in front.h now says the hook fires only with a window, because front_progress returns on no layer before it reads the hook, and docs/frontends.md has a new section, "An app that hosts the engine", that lists it. Nothing in this repository sets the hook, so its tests and regression runs don't cover it. Checked with compile_check.py, build_smoke.py and the Mac dmhost build; the hook itself was not run here.

@seedds seedds closed this Nov 2, 2026
Know-It-All-Brother pushed a commit to Know-It-All-Brother/nxnative that referenced this pull request Nov 9, 2026
…'s progress itself (seedds#742)

front_progress_hook (front.h): set before the game starts, with a window it gets each front_progress
call's title, done and total on the front end's main thread, and the front end shows no progress
screen of its own. NULL by default, so the Mac app and the iOS app keep their screens as they are.
A launcher that holds several games in one app draws the step in its own look. docs/frontends.md
lists it in a new section for apps that host the engine in-process.

Co-authored-by: v0lumehi <[email protected]>
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