Trait iced_graphics::window::compositor::Compositor
source · pub trait Compositor: Sized {
type Settings: Default;
type Renderer: Renderer;
type Surface;
// Required methods
fn new<W: HasRawWindowHandle + HasRawDisplayHandle>(
settings: Self::Settings,
compatible_window: Option<&W>
) -> Result<(Self, Self::Renderer), Error>;
fn create_surface<W: HasRawWindowHandle + HasRawDisplayHandle>(
&mut self,
window: &W
) -> Self::Surface;
fn configure_surface(
&mut self,
surface: &mut Self::Surface,
width: u32,
height: u32
);
fn fetch_information(&self) -> Information;
fn present<T: AsRef<str>>(
&mut self,
renderer: &mut Self::Renderer,
surface: &mut Self::Surface,
viewport: &Viewport,
background_color: Color,
overlay: &[T]
) -> Result<(), SurfaceError>;
}
Expand description
A graphics compositor that can draw to windows.
Required Associated Types§
Required Methods§
sourcefn new<W: HasRawWindowHandle + HasRawDisplayHandle>(
settings: Self::Settings,
compatible_window: Option<&W>
) -> Result<(Self, Self::Renderer), Error>
fn new<W: HasRawWindowHandle + HasRawDisplayHandle>( settings: Self::Settings, compatible_window: Option<&W> ) -> Result<(Self, Self::Renderer), Error>
Creates a new Compositor
.
sourcefn create_surface<W: HasRawWindowHandle + HasRawDisplayHandle>(
&mut self,
window: &W
) -> Self::Surface
fn create_surface<W: HasRawWindowHandle + HasRawDisplayHandle>( &mut self, window: &W ) -> Self::Surface
Crates a new Surface
for the given window.
sourcefn configure_surface(
&mut self,
surface: &mut Self::Surface,
width: u32,
height: u32
)
fn configure_surface( &mut self, surface: &mut Self::Surface, width: u32, height: u32 )
Configures a new Surface
with the given dimensions.
sourcefn fetch_information(&self) -> Information
fn fetch_information(&self) -> Information
Returns Information
used by this Compositor
.