Skip to main content

next_render_phase

Function next_render_phase 

Source
pub fn next_render_phase(
    current: RenderPhase,
    event: RenderEvent,
) -> RenderPhase
Expand description

Pure render-phase transition table, the analogue of frust-render’s next_phase. Total by design:

  • SurfaceCreated → Active (create or recreate),
  • SurfaceDestroyed → NoSurface,
  • SurfaceChanged → the current phase unchanged (a resize never changes whether we can render — mirrors “resize stays Ready”),
  • Pause → Paused unless there is no surface (you cannot pause what was never created),
  • Resume → Active unless there is no surface (you cannot resume onto a surface that is gone; the shell must recreate it first via SurfaceCreated).