From a83164950aedb40ab3f213d50a757ed07eabd7cc Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 4 Aug 2024 17:49:18 +0200 Subject: feat(engine): add component making a object not be drawn --- engine/src/renderer/opengl.rs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'engine/src/renderer') diff --git a/engine/src/renderer/opengl.rs b/engine/src/renderer/opengl.rs index 108c504..911f0df 100644 --- a/engine/src/renderer/opengl.rs +++ b/engine/src/renderer/opengl.rs @@ -7,6 +7,7 @@ use std::process::abort; use cstr::cstr; use ecs::component::local::Local; +use ecs::query::options::{Not, With}; use ecs::sole::Single; use ecs::system::{Into as _, System}; use ecs::{Component, Query}; @@ -14,7 +15,7 @@ use ecs::{Component, Query}; use crate::camera::Camera; use crate::color::Color; use crate::data_types::dimens::Dimens; -use crate::draw_flags::{DrawFlags, PolygonModeConfig}; +use crate::draw_flags::{DrawFlags, NoDraw, PolygonModeConfig}; use crate::event::{Present as PresentEvent, Start as StartEvent}; use crate::lighting::{DirectionalLight, GlobalLight, PointLight}; use crate::material::{Flags as MaterialFlags, Material}; @@ -96,15 +97,18 @@ fn initialize(window: Single) } fn render( - query: Query<( - Mesh, - ShaderProgram, - Material, - Option, - Option, - Option, - Option, - )>, + query: Query< + ( + Mesh, + ShaderProgram, + Material, + Option, + Option, + Option, + Option, + ), + Not>, + >, point_light_query: Query<(PointLight,)>, directional_lights: Query<(DirectionalLight,)>, camera_query: Query<(Camera,)>, -- cgit v1.2.3-18-g5258