nightshade 0.56.0

A cross-platform data-oriented game engine.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::plugins::egui::EguiState;
use crate::render::wgpu::WgpuRenderer;

/// Drains the egui frame output stashed on `world.plugin_resource_mut::<EguiState>()` and hands
/// it to the egui pass. Called early in
/// [`render_frame`](super::frame::render_frame), before the graph executes.
pub(super) fn prepare_egui_pass(renderer: &mut WgpuRenderer, world: &mut crate::ecs::world::World) {
    let Some((output, primitives)) = world.plugin_resource_mut::<EguiState>().frame_output.take()
    else {
        return;
    };
    crate::render::wgpu::pass_sync::prepare_egui_pass(
        renderer,
        &output.textures_delta,
        output.pixels_per_point,
        primitives,
    );
}