Skip to main content

Surface

Trait Surface 

Source
pub trait Surface {
    // Required methods
    fn size(&self) -> (u32, u32);
    fn resize(&mut self, width: u32, height: u32);
    fn acquire(&mut self) -> Result<Frame, SurfaceError>;
    fn present(&mut self, frame: Frame, hal: &Hal);
}
Expand description

Superficie gráfica donde llimphi pinta.

Vello (rasterizador) emite a una textura intermedia con storage binding (la única forma portable: los formatos de swapchain no aceptan writes de compute shader en muchos adapters). En present se blittea la intermedia al swapchain real y se hace el flip.

Implementaciones:

  • WinitSurface: ventana Wayland/X11 (dev + producción vía mirada).
  • WawaFramebufferSurface (TODO): framebuffer directo del kernel wawa.

Required Methods§

Source

fn size(&self) -> (u32, u32)

Source

fn resize(&mut self, width: u32, height: u32)

Source

fn acquire(&mut self) -> Result<Frame, SurfaceError>

Adquiere la textura intermedia donde el raster pinta este frame.

Source

fn present(&mut self, frame: Frame, hal: &Hal)

Blittea la intermedia al swapchain y la presenta.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§