create_app

Macro create_app 

Source
macro_rules! create_app {
    {
        CLEAR_COLOR = $color:expr,
        APP {$(
            $component:ident: $type:ty[$($param:ident),*]
        ),*},
        PASSES {$(
            $pass_idx:literal: {
                PARTS: [$(
                    {
                        PIPELINE: $pipeline:expr,
                        PREPARE: [$($prepare:ident),*],
                        RENDER: $to_render:ident,
                    }
                ),*],
                DEPTH: $depth:literal
            }
        ),*}
    } => { ... };
}
Expand description

This macro creates a App objects using a given set of components and some render pass descriptions.

Example:

create_app! {
    CLEAR_COLOR = wgpu::Color { r: 0.0, g: 0.0, b: 0.0, a: 0.0 },
 
    APP {
        ui_engine: UIEngine[render_engine],
        test: TestComponent[render_engine, ui_engine, egui],
        egui: EguiEngine[render_engine, inputs]
    },
 
    PASSES {
        0: {
            PARTS: [
                {
                    PIPELINE: "forte.test",
                    PREPARE: [],
                    RENDER: test,
                }
            ],
            DEPTH: true
        },
        1: {
            PARTS: [
                {
                    PIPELINE: "forte.ui",
                    PREPARE: [],
                    RENDER: ui_engine,
                },
                {
                    PIPELINE: "forte.ui",
                    PREPARE: [],
                    RENDER: egui,
                }
            ],
            DEPTH: false
        }
    }
}