Breeze builds and runs with no raylib anywhere, on Ziran 7fbc8152 and Kryon b5a61b37, with plot, entity, apps, css and game2d pinned to that Kryon, so the lock has one Kryon and no raylib package. - Linux and Windows run on Kryon's SDL2 and Cairo desktop host; WebP decodes with the linked libwebp (KRYON_WEBP_LINKED). - Android owns its NativeActivity loop on Kryon's android_runtime: Pixmap on the activity's surface, android_touch input and Android's typefaces, paced to the app's frame target. The CMake build drops breeze_raylib, GLES and the raylib link wraps, and links Kryon's fopen wrapper. - The browser reaches Kryon's canvas modules directly. - Audio is Ziran's std audio: its mixer, the SDL, AAudio and OpenSL ES sinks, the WAV, MP3 and Vorbis decoders and the audio package's Opus. The MP3 and Vorbis archives come from Ziran's own codec recipes. The browser keeps Kryon's Web Audio. - Host modules choose the desktop host, Android, the canvas or, for native tests that select none, a headless host with no window, input or audio device. host_keys.zi and text_input_host.zi replace raylib_host.zi and raylib_text_input.zi; the log is one implementation, with logcat on Android and the C runtime's open flags on Windows. - The Makefile, Click packaging, CI and release workflows build no raylib. - Tests: radio, app log, asset files, DPI, legacy sessions, sync recovery and the Android JNI bridge run without raylib stubs; voice playback is a Ziran test of real Ogg Opus narration through Ziran's mixer. Tests that only exercised raylib internals are removed. - AppsControllerSha256 is the controller built from Apps b96d9afe on this graph. Local tests: Linux desktop window, Habits UI and the Ziran and native tests above pass on a private Xvfb; the Android debug APK runs on a Pixel 4a; the Windows package runs under Wine on a private Xvfb. Co-Authored-By: Claude Opus 5.5 <[email protected]>
95 lines
3.2 KiB
Ziran
95 lines
3.2 KiB
Ziran
#import, file "../src/app/app_frame_transition.zi";
|
|
#import, file "../src/app/app_types.zi";
|
|
#import "drawing_props"
|
|
#import "frame_transition"
|
|
|
|
released: s32;
|
|
wrong_texture: bool;
|
|
// The complete app state includes large storage buffers; keep the fixture
|
|
// outside the test thread's stack, as the native application does.
|
|
app: InnerBreeze;
|
|
|
|
#program_export
|
|
DisposeFrameTexture :: (texture: Texture2D) {
|
|
released += 1
|
|
if texture.id != 42 {
|
|
wrong_texture = true
|
|
}
|
|
}
|
|
|
|
Frame :: () -> FrameSurface {
|
|
surface: FrameSurface
|
|
surface.texture = Texture2D.{42, 20, 20, 1, 7}
|
|
return surface
|
|
}
|
|
|
|
Upright :: () -> FrameSurface {
|
|
surface := Frame()
|
|
surface.upright = true
|
|
return surface
|
|
}
|
|
|
|
Prepared :: (app: *InnerBreeze, owned: bool) {
|
|
app.ui.route_transition_surface = Frame()
|
|
app.ui.route_transition_surface_owned = owned
|
|
app.ui.route_transition_active = true
|
|
app.ui.route_transition_pending = true
|
|
}
|
|
|
|
Cleared :: (app: *InnerBreeze) -> bool {
|
|
return app.ui.route_transition_surface.texture.id == 0 &&
|
|
!app.ui.route_transition_surface_owned &&
|
|
!app.ui.route_transition_active && !app.ui.route_transition_pending
|
|
}
|
|
|
|
#program_export
|
|
main :: () -> s32 {
|
|
// The renderer owns borrowed retained frames. Never delete them twice.
|
|
Prepared(*app, false)
|
|
app_route_transition_cancel(*app)
|
|
if released != 0 || !Cleared(*app) { return 1 }
|
|
|
|
// An independently captured frame is released while its context is valid.
|
|
Prepared(*app, true)
|
|
app_route_transition_cancel(*app)
|
|
if released != 1 || wrong_texture || !Cleared(*app) { return 2 }
|
|
|
|
// Old context names may now identify unrelated textures. Discard only.
|
|
Prepared(*app, true)
|
|
app_route_transition_cancel(*app, true)
|
|
if released != 1 || !Cleared(*app) { return 3 }
|
|
app_route_transition_cancel(*app)
|
|
app_route_transition_cancel(null)
|
|
if released != 1 { return 4 }
|
|
|
|
// A second route must replace an in-flight animation, including its
|
|
// owned texture, instead of ignoring the new navigation.
|
|
Prepared(*app, true)
|
|
app_route_transition_request(*app)
|
|
if released != 2 || wrong_texture || app.ui.route_transition_active ||
|
|
!app.ui.route_transition_pending || app.ui.route_transition_surface.texture.id != 0 {
|
|
return 5
|
|
}
|
|
app_route_transition_capture(*app, Frame(), 1.0, false)
|
|
if !app.ui.route_transition_active || app.ui.route_transition_pending {
|
|
return 6
|
|
}
|
|
if app.ui.route_transition_surface.upright { return 8 }
|
|
app_route_transition_request(*app)
|
|
if released != 2 || app.ui.route_transition_active ||
|
|
!app.ui.route_transition_pending {
|
|
return 7
|
|
}
|
|
|
|
// The desktop host's snapshot of the previous screen is upright, and the
|
|
// fade must draw it that way. Opening Habits' shop drew it flipped, which
|
|
// the desktop raster rejects: the frame failed and the app quit.
|
|
app_route_transition_capture(*app, Upright(), 2.0, true)
|
|
if !app.ui.route_transition_active || !app.ui.route_transition_surface.upright {
|
|
return 9
|
|
}
|
|
app_route_transition_advance(*app, 2.0 + cast(float64)APP_ROUTE_TRANSITION_SECONDS)
|
|
if released != 3 || wrong_texture || !Cleared(*app) { return 11 }
|
|
return 0
|
|
}
|