Skip to content

Commit

Permalink
Adjusted modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
facundo-villa committed Nov 9, 2023
1 parent 5d31f9e commit d0a555d
Show file tree
Hide file tree
Showing 8 changed files with 349 additions and 349 deletions.
8 changes: 4 additions & 4 deletions src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl Application for BaseApplication {
use log::{info, trace};
use maths_rs::prelude::Base;

use crate::{orchestrator, rendering::render_system, window_system, input_manager, Vector2, rendering::{self}, render_domain, resource_manager, file_tracker};
use crate::{orchestrator, rendering::render_system, window_system, input_manager, Vector2, rendering::{self}, resource_manager, file_tracker};

/// An orchestrated application is an application that uses the orchestrator to manage systems.
/// It is the recommended way to create a simple application.
Expand Down Expand Up @@ -127,7 +127,7 @@ pub struct GraphicsApplication {
window_system_handle: orchestrator::EntityHandle<window_system::WindowSystem>,
mouse_device_handle: input_manager::DeviceHandle,
input_system_handle: orchestrator::EntityHandle<input_manager::InputManager>,
visibility_render_domain_handle: orchestrator::EntityHandle<render_domain::VisibilityWorldRenderDomain>,
visibility_render_domain_handle: orchestrator::EntityHandle<rendering::visibility_model::render_domain::VisibilityWorldRenderDomain>,
render_system_handle: orchestrator::EntityHandle<render_system::RenderSystemImplementation>,
}

Expand Down Expand Up @@ -165,7 +165,7 @@ impl Application for GraphicsApplication {

let render_system_handle = rendering::create_render_system(&orchestrator);

let visibility_render_domain_handle = orchestrator.spawn_entity(render_domain::VisibilityWorldRenderDomain::new()).unwrap();
let visibility_render_domain_handle = orchestrator.spawn_entity(rendering::visibility_model::render_domain::VisibilityWorldRenderDomain::new()).unwrap();

orchestrator.spawn_entity(rendering::render_orchestrator::RenderOrchestrator::new());

Expand Down Expand Up @@ -224,7 +224,7 @@ impl Application for GraphicsApplication {
// visibility_render_domain.render(self.get_orchestrator(), render_system, self.tick_count as u32);
// });

self.application.get_orchestrator().invoke_mut(self.visibility_render_domain_handle.copy(), render_domain::VisibilityWorldRenderDomain::render);
self.application.get_orchestrator().invoke_mut(self.visibility_render_domain_handle.copy(), rendering::visibility_model::render_domain::VisibilityWorldRenderDomain::render);

if !window_res {
self.application.close();
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pub mod input_manager;
pub mod file_tracker;
pub mod executor;
pub mod camera;
pub mod render_domain;

pub mod math;
pub mod rendering;
Expand Down
24 changes: 24 additions & 0 deletions src/rendering/mesh.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//! Mesh component module
use crate::orchestrator;

#[derive(component_derive::Component)]
pub struct Mesh{
pub resource_id: &'static str,
pub material_id: &'static str,
#[field] pub transform: maths_rs::Mat4f,
}

impl orchestrator::Entity for Mesh {}

impl orchestrator::Component for Mesh {
// type Parameters<'a> = MeshParameters;
}

impl Mesh {
fn set_transform(&mut self, _orchestrator: orchestrator::OrchestratorReference, value: maths_rs::Mat4f) { self.transform = value; }

fn get_transform(&self) -> maths_rs::Mat4f { self.transform }

pub const fn transform() -> orchestrator::Property<(), Self, maths_rs::Mat4f> { orchestrator::Property::Component { getter: Mesh::get_transform, setter: Mesh::set_transform } }
}
3 changes: 3 additions & 0 deletions src/rendering/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ pub mod render_system;

pub mod directional_light;
pub mod point_light;
pub mod mesh;

pub mod cct;
mod vulkan_render_system;

pub mod visibility_model;

pub fn create_render_system(orchestrator: &orchestrator::Orchestrator) -> orchestrator::EntityHandle<render_system::RenderSystemImplementation> {
orchestrator.spawn_entity(vulkan_render_system::VulkanRenderSystem::new_as_system()).unwrap()
}
1 change: 1 addition & 0 deletions src/rendering/visibility_model/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod render_domain;
Loading

0 comments on commit d0a555d

Please sign in to comment.