Struct surfman_chains::SwapChain[][src]

pub struct SwapChain<Device: DeviceAPI>(_);

A thread-safe swap chain.

Implementations

impl<Device: DeviceAPI> SwapChain<Device>[src]

pub fn swap_buffers(
    &self,
    device: &mut Device,
    context: &mut Device::Context,
    preserve_buffer: PreserveBuffer<'_>
) -> Result<(), Error>
[src]

Swap the back and front buffers. Called by the producer. Returns an error if context is not the producer context for this swap chain.

pub fn take_attachment_from(
    &self,
    device: &mut Device,
    context: &mut Device::Context,
    other: &SwapChain<Device>
) -> Result<(), Error>
[src]

Swap the attached swap chain. Called by the producer. Returns an error if context is not the producer context for both swap chains. Returns an error if this swap chain is attached, or the other swap chain is detached.

pub fn resize(
    &self,
    device: &mut Device,
    context: &mut Device::Context,
    size: Size2D<i32>
) -> Result<(), Error>
[src]

Resize the swap chain. This creates a new back buffer of the appropriate size, and destroys the old one. Called by the producer. Returns an error if context is not the producer context for this swap chain.

pub fn size(&self) -> Size2D<i32>[src]

Get the current size. Called by a consumer.

pub fn take_surface_texture(
    &self,
    device: &Device,
    context: &mut Device::Context
) -> Result<Device::SurfaceTexture, Error>
[src]

Take the current back buffer. Called by a producer.

pub fn recycle_surface_texture(
    &self,
    device: &Device,
    context: &mut Device::Context,
    surface_texture: Device::SurfaceTexture
) -> Result<(), Error>
[src]

Recycle the current back buffer. Called by a producer.

pub fn take_pending_surface(&self) -> Option<Device::Surface>[src]

Take the current front buffer. Returns None if there is no current front buffer. Called by a consumer.

pub fn clear_surface(
    &self,
    device: &mut Device,
    context: &mut Device::Context,
    gl: &Gl,
    color: [f32; 4]
) -> Result<(), Error>
[src]

Clear the current back buffer. Called by the producer. Returns an error if context is not the producer context for this swap chain.

pub fn is_attached(&self) -> bool[src]

Is this the attached swap chain?

pub fn destroy(
    &self,
    device: &mut Device,
    context: &mut Device::Context
) -> Result<(), Error>
[src]

Destroy the swap chain. Called by the producer. Returns an error if context is not the producer context for this swap chain.

pub fn create_attached(
    device: &mut Device,
    context: &mut Device::Context,
    surface_access: SurfaceAccess
) -> Result<SwapChain<Device>, Error>
[src]

Create a new attached swap chain

pub fn create_detached(
    device: &mut Device,
    context: &mut Device::Context,
    surface_access: SurfaceAccess,
    size: Size2D<i32>
) -> Result<SwapChain<Device>, Error>
[src]

Create a new detached swap chain

Trait Implementations

impl<Device: DeviceAPI> Clone for SwapChain<Device>[src]

impl<Device> SwapChainAPI for SwapChain<Device> where
    Device: 'static + DeviceAPI,
    Device::Surface: Send
[src]

type Surface = Device::Surface

fn take_surface(&self) -> Option<Device::Surface>[src]

Take the current front buffer. Returns the most recent recycled surface if there is no current front buffer. Called by a consumer.

fn recycle_surface(&self, surface: Device::Surface)[src]

Recycle the current front buffer. Called by a consumer.

Auto Trait Implementations

impl<Device> RefUnwindSafe for SwapChain<Device>

impl<Device> Send for SwapChain<Device> where
    <Device as Device>::Surface: Send

impl<Device> Sync for SwapChain<Device> where
    <Device as Device>::Surface: Send

impl<Device> Unpin for SwapChain<Device>

impl<Device> UnwindSafe for SwapChain<Device>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.