summaryrefslogtreecommitdiff
path: root/engine/src/rendering.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-07-21 14:32:26 +0200
committerHampusM <hampus@hampusmat.com>2026-07-21 14:32:26 +0200
commit63675d4168224b66d28c9d64a8e121ef397d4edd (patch)
tree2c2c13535b971dd95a354099347cd6a530e16796 /engine/src/rendering.rs
parent67bb995ffdd201997758701eeda35b4373b51104 (diff)
refactor(engine): use pair macro in phase entity declarations
Diffstat (limited to 'engine/src/rendering.rs')
-rw-r--r--engine/src/rendering.rs35
1 files changed, 8 insertions, 27 deletions
diff --git a/engine/src/rendering.rs b/engine/src/rendering.rs
index 4871f08..e67a457 100644
--- a/engine/src/rendering.rs
+++ b/engine/src/rendering.rs
@@ -18,7 +18,7 @@ use crate::ecs::sole::Single;
use crate::ecs::system::initializable::Initializable;
use crate::ecs::system::observer::Observe;
use crate::ecs::system::Into;
-use crate::ecs::{declare_entity, Component, Query, Sole};
+use crate::ecs::{declare_entity, pair, Component, Query, Sole};
use crate::image::Image;
use crate::mesh::Mesh;
use crate::rendering::blending::Config as BlendingConfig;
@@ -42,32 +42,13 @@ pub mod shader;
static NEXT_SURFACE_ID: AtomicU64 = AtomicU64::new(0);
-declare_entity!(
- pub PRE_RENDER_PHASE,
- (
- Phase,
- Pair::builder()
- .relation::<ChildOf>()
- .target_id(*POST_UPDATE_PHASE)
- .build()
- )
-);
-
-declare_entity!(
- pub RENDER_PHASE,
- (
- Phase,
- Pair::builder()
- .relation::<ChildOf>()
- .target_id(*PRE_RENDER_PHASE)
- .build()
- )
-);
-
-declare_entity!(
- pub POST_RENDER_PHASE,
- (Phase, Pair::builder().relation::<ChildOf>().target_id(*RENDER_PHASE).build())
-);
+declare_entity! {
+pub PRE_RENDER_PHASE: (Phase, pair!(ChildOf, { *POST_UPDATE_PHASE }));
+
+pub RENDER_PHASE: (Phase, pair!(ChildOf, { *PRE_RENDER_PHASE }));
+
+pub POST_RENDER_PHASE: (Phase, pair!(ChildOf, { *RENDER_PHASE }));
+}
builder! {
#[builder(name=ExtensionBuilder, derives=(Debug, Clone, Default))]