diff options
author | 2024-03-22 07:09:51 +0100 | |
---|---|---|
committer | 2024-03-22 07:09:51 +0100 | |
commit | 5137d655e6bbd29581fc1469d0385515113f2999 (patch) | |
tree | 46a3ff77014d7e7bd2047ce7c6e7dfe9b3a596cd /wgpu/src/window | |
parent | 4f2f40c68b4647f281d34034beb159a41422aa06 (diff) | |
download | iced-5137d655e6bbd29581fc1469d0385515113f2999.tar.gz iced-5137d655e6bbd29581fc1469d0385515113f2999.tar.bz2 iced-5137d655e6bbd29581fc1469d0385515113f2999.zip |
Allow custom renderers in `Program` and `Application`
Diffstat (limited to 'wgpu/src/window')
-rw-r--r-- | wgpu/src/window/compositor.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index 328ad781..74dfadba 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -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 { |