Add function "render_into" to the ECS system
This is needed for the imgui integration
This commit is contained in:
parent
a17a6016b8
commit
111c42a746
1 changed files with 7 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use glam::{Mat4, Quat, Vec3};
|
||||
use hecs::{Entity, World};
|
||||
use crate::{render::{GliumRenderer, Renderer}, model};
|
||||
use crate::{render::GliumRenderer, model};
|
||||
|
||||
/// This system joins the renderer and ECS,
|
||||
/// and provides tools to use them together
|
||||
|
|
@ -34,6 +34,12 @@ impl ECSRenderer {
|
|||
pub fn render(&mut self) {
|
||||
self.renderer.render(&self.world);
|
||||
}
|
||||
|
||||
/// Render into an existing glium target surface. Useful for composing with
|
||||
/// other render passes (e.g. Dear ImGui).
|
||||
pub fn render_into<S: glium::Surface>(&mut self, target: &mut S) {
|
||||
self.renderer.render_into(&self.world, target);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue