๐Ÿ“ฆ tychedelia / sepiascraped

๐Ÿ“„ main.rs ยท 79 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79use crate::event::SpawnOp;
use crate::index::UniqueIndexPlugin;
use crate::op::component::ComponentPlugin;
use crate::op::material::MaterialPlugin;
use crate::op::mesh::MeshPlugin;
use crate::op::texture::TexturePlugin;
use crate::param::ParamPlugin;
use crate::render::RenderPlugin;
use crate::render_layers::{RenderLayerManager, RenderLayerPlugin};
use crate::script::ScriptPlugin;
use crate::ui::UiPlugin;
use bevy::diagnostic::{
    EntityCountDiagnosticsPlugin, FrameTimeDiagnosticsPlugin, SystemInformationDiagnosticsPlugin,
};
use bevy::prelude::*;
use bevy_egui::EguiPlugin;
use bevy_prototype_lyon::plugin::ShapePlugin;
use iyes_perf_ui::prelude::*;

mod event;
mod index;
mod op;
mod param;
mod render;
mod render_layers;
mod script;
mod ui;

fn main() {
    let mut app = App::new();

    app.add_plugins((
        DefaultPlugins,
        ScriptPlugin,
        ParamPlugin,
        EguiPlugin,
        RenderPlugin,
        TexturePlugin,
        MeshPlugin,
        MaterialPlugin,
        ComponentPlugin,
        UiPlugin,
        ShapePlugin,
        RenderLayerPlugin,
        UniqueIndexPlugin::<OpName>::default(),
    ))
    .add_event::<SpawnOp>()
    .configure_sets(
        Update,
        (Sets::Ui, Sets::Script, Sets::Spawn, Sets::Graph, Sets::Params, Sets::Execute).chain(),
    )
    .add_systems(Startup, setup);
    bevy_mod_debugdump::print_schedule_graph(&mut app, Update);
    app.run();
}

#[derive(Component, Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct OpName(pub String);

fn setup(mut commands: Commands, mut images: ResMut<Assets<Image>>) {
}

/// The system sets for the application.
#[derive(SystemSet, Hash, PartialEq, Eq, Clone, Debug)]
enum Sets {
    /// Ui updates and events
    Ui,
    /// Run all scripts
    Script,
    /// Spawn ops
    Spawn,
    /// Updates to the op graph
    Graph,
    /// Param related behavior, i.e. preparing an op to execute
    Params,
    /// Execute ops
    Execute,
}