diff options
author | HampusM <hampus@hampusmat.com> | 2025-04-23 13:22:05 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2025-04-23 13:22:05 +0200 |
commit | 3884ca7acbed316ebeea2b1e20507dcebae9bd49 (patch) | |
tree | e6e146207493c81514c22378ed41cfe8148c017a | |
parent | 10cab804630d77677ae94b838a153fd6050742a0 (diff) |
-rw-r--r-- | engine/src/renderer.rs | 6 | ||||
-rw-r--r-- | engine/src/renderer/opengl.rs | 5 | ||||
-rw-r--r-- | engine/src/window.rs | 5 |
3 files changed, 12 insertions, 4 deletions
diff --git a/engine/src/renderer.rs b/engine/src/renderer.rs index 2544919..17bc925 100644 --- a/engine/src/renderer.rs +++ b/engine/src/renderer.rs @@ -1 +1,7 @@ +use ecs::pair::{ChildOf, Pair}; +use ecs::phase::{Phase, UPDATE as UPDATE_PHASE}; +use ecs::static_entity; + pub mod opengl; + +static_entity!(pub RENDER_PHASE, (Phase, Pair::new::<ChildOf>(*UPDATE_PHASE))); diff --git a/engine/src/renderer/opengl.rs b/engine/src/renderer/opengl.rs index 84af219..5666061 100644 --- a/engine/src/renderer/opengl.rs +++ b/engine/src/renderer/opengl.rs @@ -9,7 +9,7 @@ use std::process::abort; use ecs::actions::Actions; use ecs::component::local::Local; -use ecs::phase::{PRESENT as PRESENT_PHASE, START as START_PHASE}; +use ecs::phase::START as START_PHASE; use ecs::query::term::Without; use ecs::sole::Single; use ecs::system::{Into as _, System}; @@ -62,6 +62,7 @@ use crate::opengl::{ ContextFlags, }; use crate::projection::{ClipVolume, Projection}; +use crate::renderer::RENDER_PHASE; use crate::texture::{Id as TextureId, Texture}; use crate::transform::{Position, Scale}; use crate::util::{defer, Defer, RefOrValue}; @@ -90,7 +91,7 @@ impl ecs::extension::Extension for Extension collector.add_system(*START_PHASE, initialize); collector.add_system( - *PRESENT_PHASE, + *RENDER_PHASE, render .into_system() .initialize((GlobalGlObjects::default(),)), diff --git a/engine/src/window.rs b/engine/src/window.rs index 614ed92..d342341 100644 --- a/engine/src/window.rs +++ b/engine/src/window.rs @@ -5,7 +5,7 @@ use bitflags::bitflags; use ecs::actions::Actions; use ecs::extension::Collector as ExtensionCollector; use ecs::pair::{ChildOf, Pair}; -use ecs::phase::{Phase, PRESENT as PRESENT_PHASE, START as START_PHASE}; +use ecs::phase::{Phase, START as START_PHASE}; use ecs::sole::Single; use ecs::{static_entity, Sole}; use glfw::window::{Hint as WindowCreationHint, HintValue as WindowCreationHintValue}; @@ -13,11 +13,12 @@ use glfw::WindowSize; use util_macros::VariantArr; use crate::data_types::dimens::Dimens; +use crate::renderer::RENDER_PHASE; use crate::vector::Vec2; static_entity!( pub UPDATE_PHASE, - (Phase, Pair::new::<ChildOf>(*PRESENT_PHASE)) + (Phase, Pair::new::<ChildOf>(*RENDER_PHASE)) ); #[derive(Debug, Sole)] |