Rendering, runtime, platform, asset, audio, and glTF infrastructure for Kagura
Dependencies
pub(open) trait EngineGame {
fn update_game(Self, InputSnapshot) -> Unit
fn draw_game(Self, EngineContext) -> Array[DrawTrianglesCommand]
}pub(all) struct EngineContext {
dst : ImageHandle
shader : ShaderHandle
screen_w : Int
screen_h : Int
}pub(all) struct FrameProfile {
fps : Double
frame_time_ms : Double
update_ms : Double
draw_ms : Double
gpu_frame_ms : Double
draw_calls : Int
vertex_count : Int
asset_inflight : Int
} derive(Debug)impl Show for FrameProfilepub(all) struct LifecycleHooks {
on_start : (String, String) -> Unit
on_stop : () -> Unit
}fn build_profiler_hud(cmds : Array[DrawTrianglesCommand], dst : ImageHandle, shader : ShaderHandle, profile : FrameProfile, screen_w : Double, screen_h : Double) -> Unitfn[T : GraphicsDriver] render_commands(graphics : T, cmds : Array[DrawTrianglesCommand], clear_color? : Color, clear_enabled? : Bool) -> Unit raisefn run(update~ : (InputSnapshot) -> Unit, draw~ : (EngineContext) -> Array[DrawTrianglesCommand], on_frame? : () -> Unit, after_render? : (Double, Double) -> Unit, audio_ctx? : MixerAudioContext, audio_frames_per_tick? : Int, width? : Int, height? : Int, title? : String, canvas? : String) -> Unitfn[T : EngineGame] run_game(game : T, on_frame? : () -> Unit, after_render? : (Double, Double) -> Unit, audio_ctx? : MixerAudioContext, audio_frames_per_tick? : Int, width? : Int, height? : Int, title? : String, canvas? : String) -> UnitRendering, runtime, platform, asset, audio, and glTF infrastructure for Kagura
Dependencies