Allow custom renderers in Program and Application

This commit is contained in:
Héctor Ramón Jiménez 2024-03-22 07:09:51 +01:00
parent 4f2f40c68b
commit 5137d655e6
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
19 changed files with 162 additions and 122 deletions

View file

@ -1,9 +1,8 @@
//! Connect a window with a renderer.
use crate::core::{Color, Size};
use crate::graphics;
use crate::graphics::color;
use crate::graphics::compositor;
use crate::graphics::{Error, Viewport};
use crate::graphics::{self, Error, Viewport};
use crate::{Backend, Primitive, Renderer, Settings};
use std::future::Future;
@ -225,15 +224,14 @@ pub fn present<T: AsRef<str>>(
}
impl graphics::Compositor for Compositor {
type Settings = Settings;
type Renderer = Renderer;
type Surface = wgpu::Surface<'static>;
fn new<W: compositor::Window>(
settings: Self::Settings,
settings: graphics::Settings,
compatible_window: W,
) -> impl Future<Output = Result<Self, Error>> {
new(settings, compatible_window)
new(settings.into(), compatible_window)
}
fn create_renderer(&self) -> Self::Renderer {