Allow custom renderers in Program and Application
This commit is contained in:
parent
4f2f40c68b
commit
5137d655e6
19 changed files with 162 additions and 122 deletions
|
|
@ -2,16 +2,16 @@
|
|||
use crate::core::image;
|
||||
use crate::core::svg;
|
||||
use crate::core::Size;
|
||||
use crate::Mesh;
|
||||
use crate::{Compositor, Mesh, Renderer};
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
/// The graphics backend of a [`Renderer`].
|
||||
///
|
||||
/// [`Renderer`]: crate::Renderer
|
||||
pub trait Backend {
|
||||
pub trait Backend: Sized {
|
||||
/// The compositor of this [`Backend`].
|
||||
type Compositor;
|
||||
type Compositor: Compositor<Renderer = Renderer<Self>>;
|
||||
|
||||
/// The custom kind of primitives this [`Backend`] supports.
|
||||
type Primitive: TryFrom<Mesh, Error = &'static str>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue