Skip to main content

run

Function run 

Source
pub fn run<T: 'static, FRender, FEventDev, FEventWin, FGui>(
    user_state: T,
    scene: Scene,
    ui_settings: UiSettings,
    graphics_settings: GraphicsSettings,
    render_handler: FRender,
    event_dev_handler: FEventDev,
    event_win_handler: FEventWin,
    gui_handler: FGui,
)
where FRender: FnMut(&mut T, &mut Scene, f32) -> EngineUpdates + 'static, FEventDev: FnMut(&mut T, DeviceEvent, &mut Scene, bool, f32) -> EngineUpdates + 'static, FEventWin: FnMut(&mut T, WindowEvent, &mut Scene, f32) -> EngineUpdates + 'static, FGui: FnMut(&mut T, &Context, &mut Scene) -> EngineUpdates + 'static,
Expand description

This is the entry point to the renderer. It’s called by the application to initialize the event loop. It maintains ownership of the user state, and can be interacted with through the _handler callback functions.

user_state is arbitrary application state, to maintain ownership of. render_handler allows application code to run each frame. event_dev_handler allows application code to handle device events, such as user input. event_win_handler allows application code to window events. gui_handler is where the EGUI code is written to describe the UI.