Skip to main content

request_gpu

Function request_gpu 

Source
pub fn request_gpu<F>(app: Entity, ready: F) -> OnFrame
where F: FnOnce(&mut World, &Gpu) + 'static,
Expand description

Start the app’s GPU request once the window exists, and run ready with the context once it lands.

The request runs as a task of the world it will set up, driven by the pump that opens each frame; this behaviour reads the answer on the frames that follow and runs the callback as a queued command with a mutable world, between two event callbacks. A failed request is logged and sets the app’s ExitRequest.