-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: generic render bind, propagate errors
- Loading branch information
1 parent
f5c04af
commit 8d433e4
Showing
15 changed files
with
163 additions
and
544 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
#[cfg(feature = "window")] | ||
mod window; | ||
use std::error::Error; | ||
|
||
#[cfg(feature = "window")] | ||
pub use window::RenderWindow; | ||
pub trait BindRenderer<T> { | ||
#[allow(async_fn_in_trait)] | ||
async fn bind(self, target: &T) -> Result<Box<dyn Renderer>, Box<dyn Error + Send + Sync>> | ||
where | ||
Self: Sized; | ||
} | ||
|
||
pub trait Renderer { | ||
fn render_notifier(&self) -> async_channel::Receiver<()>; | ||
|
||
fn render(&mut self); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.