diff options
Diffstat (limited to 'graphics/src/window')
-rw-r--r-- | graphics/src/window/compositor.rs | 13 | ||||
-rw-r--r-- | graphics/src/window/gl_compositor.rs | 27 |
2 files changed, 16 insertions, 24 deletions
diff --git a/graphics/src/window/compositor.rs b/graphics/src/window/compositor.rs index 7674f227..0bc8cbc8 100644 --- a/graphics/src/window/compositor.rs +++ b/graphics/src/window/compositor.rs @@ -16,14 +16,12 @@ pub trait Compositor: Sized { /// The swap chain of the backend. type SwapChain; - /// Creates a new [`Backend`]. - /// - /// [`Backend`]: trait.Backend.html + /// Creates a new [`Compositor`]. fn new(settings: Self::Settings) -> Result<(Self, Self::Renderer), Error>; /// Crates a new [`Surface`] for the given window. /// - /// [`Surface`]: #associatedtype.Surface + /// [`Surface`]: Self::Surface fn create_surface<W: HasRawWindowHandle>( &mut self, window: &W, @@ -31,8 +29,8 @@ pub trait Compositor: Sized { /// Crates a new [`SwapChain`] for the given [`Surface`]. /// - /// [`SwapChain`]: #associatedtype.SwapChain - /// [`Surface`]: #associatedtype.Surface + /// [`SwapChain`]: Self::SwapChain + /// [`Surface`]: Self::Surface fn create_swap_chain( &mut self, surface: &Self::Surface, @@ -42,8 +40,7 @@ pub trait Compositor: Sized { /// Draws the output primitives to the next frame of the given [`SwapChain`]. /// - /// [`SwapChain`]: #associatedtype.SwapChain - /// [`Surface`]: #associatedtype.Surface + /// [`SwapChain`]: Self::SwapChain fn draw<T: AsRef<str>>( &mut self, renderer: &mut Self::Renderer, diff --git a/graphics/src/window/gl_compositor.rs b/graphics/src/window/gl_compositor.rs index 1f37642e..34d70be3 100644 --- a/graphics/src/window/gl_compositor.rs +++ b/graphics/src/window/gl_compositor.rs @@ -15,28 +15,27 @@ use core::ffi::c_void; /// If you implement an OpenGL renderer, you can implement this trait to ease /// integration with existing windowing shells, like `iced_glutin`. pub trait GLCompositor: Sized { - /// The renderer of the [`Compositor`]. + /// The renderer of the [`GLCompositor`]. /// /// This should point to your renderer type, which could be a type alias /// of the [`Renderer`] provided in this crate with with a specific /// [`Backend`]. /// - /// [`Compositor`]: trait.Compositor.html - /// [`Renderer`]: ../struct.Renderer.html - /// [`Backend`]: ../backend/trait.Backend.html + /// [`Renderer`]: crate::Renderer + /// [`Backend`]: crate::Backend type Renderer: iced_native::Renderer; - /// The settings of the [`Compositor`]. + /// The settings of the [`GLCompositor`]. /// /// It's up to you to decide the configuration supported by your renderer! type Settings: Default; - /// Creates a new [`Compositor`] and [`Renderer`] with the given + /// Creates a new [`GLCompositor`] and [`Renderer`] with the given /// [`Settings`] and an OpenGL address loader function. /// - /// [`Compositor`]: trait.Compositor.html - /// [`Renderer`]: #associatedtype.Renderer - /// [`Backend`]: ../backend/trait.Backend.html + /// [`Renderer`]: crate::Renderer + /// [`Backend`]: crate::Backend + /// [`Settings`]: Self::Settings #[allow(unsafe_code)] unsafe fn new( settings: Self::Settings, @@ -44,19 +43,15 @@ pub trait GLCompositor: Sized { ) -> Result<(Self, Self::Renderer), Error>; /// Returns the amount of samples that should be used when configuring - /// an OpenGL context for this [`Compositor`]. - /// - /// [`Compositor`]: trait.Compositor.html + /// an OpenGL context for this [`GLCompositor`]. fn sample_count(settings: &Self::Settings) -> u32; - /// Resizes the viewport of the [`Compositor`]. - /// - /// [`Compositor`]: trait.Compositor.html + /// Resizes the viewport of the [`GLCompositor`]. fn resize_viewport(&mut self, physical_size: Size<u32>); /// Draws the provided output with the given [`Renderer`]. /// - /// [`Compositor`]: trait.Compositor.html + /// [`Renderer`]: crate::Renderer fn draw<T: AsRef<str>>( &mut self, renderer: &mut Self::Renderer, |