[][src]Trait surfman_chains::SurfaceProvider

pub trait SurfaceProvider {
    fn recycle_front_buffer(
        &mut self,
        device: &mut Device,
        context_id: ContextID
    );
fn recycle_surface(&mut self, surface: Surface);
fn provide_surface(
        &mut self,
        device: &mut Device,
        context: &mut Context,
        context_id: ContextID,
        size: Size2D<i32>
    ) -> Result<Surface, Error>;
fn take_front_buffer(&mut self) -> Option<Surface>;
fn set_front_buffer(
        &mut self,
        device: &mut Device,
        context: &mut Context,
        context_id: ContextID,
        new_front_buffer: Surface
    ) -> Result<(), Error>;
fn create_sized_surface(
        &mut self,
        device: &mut Device,
        context: &mut Context,
        size: Size2D<i32>
    ) -> Result<Surface, Error>;
fn destroy_all_surfaces(
        &mut self,
        device: &mut Device,
        context: &mut Context
    ) -> Result<(), Error>; }

An abstract swapchain backend that is responsible for managing surfaces used by that swapchain.

Required methods

fn recycle_front_buffer(&mut self, device: &mut Device, context_id: ContextID)

A notification that any previous front buffer can be recycled.

fn recycle_surface(&mut self, surface: Surface)

A notification to recycle the provided surface.

fn provide_surface(
    &mut self,
    device: &mut Device,
    context: &mut Context,
    context_id: ContextID,
    size: Size2D<i32>
) -> Result<Surface, Error>

The swapchain requires a new surface.

fn take_front_buffer(&mut self) -> Option<Surface>

Obtain the current front buffer surface from this provider.

fn set_front_buffer(
    &mut self,
    device: &mut Device,
    context: &mut Context,
    context_id: ContextID,
    new_front_buffer: Surface
) -> Result<(), Error>

Inform the provider of the new front buffer surface.

fn create_sized_surface(
    &mut self,
    device: &mut Device,
    context: &mut Context,
    size: Size2D<i32>
) -> Result<Surface, Error>

Return a new surface with the desired size.

fn destroy_all_surfaces(
    &mut self,
    device: &mut Device,
    context: &mut Context
) -> Result<(), Error>

Ensure any outstanding tracked surfaces are appropriately destroyed.

Loading content...

Implementors

impl SurfaceProvider for SurfmanProvider[src]

Loading content...