mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
break down engine modules
This commit is contained in:
parent
f6c603bf73
commit
905486edbd
16 changed files with 376 additions and 352 deletions
12
engine/src/output/render.rs
Normal file
12
engine/src/output/render.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
use crate::*;
|
||||
|
||||
/// Custom layout and rendering.
|
||||
pub trait Render<E: Engine>: Send + Sync {
|
||||
fn layout (&self, area: E::Area) -> E::Area;
|
||||
fn render (&self, output: &mut E::Output);
|
||||
}
|
||||
|
||||
impl<E: Engine, C: Content<E>> Render<E> for C {
|
||||
fn layout (&self, area: E::Area) -> E::Area { Content::layout(self, area) }
|
||||
fn render (&self, output: &mut E::Output) { Content::render(self, output) }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue