Struct surfman_chains::SwapChains
source · pub struct SwapChains<SwapChainID: Eq + Hash, Device: DeviceAPI> { /* private fields */ }
Expand description
A thread-safe collection of swap chains.
Implementations§
source§impl<SwapChainID, Device> SwapChains<SwapChainID, Device>where
SwapChainID: Clone + Eq + Hash + Debug,
Device: DeviceAPI,
impl<SwapChainID, Device> SwapChains<SwapChainID, Device>where SwapChainID: Clone + Eq + Hash + Debug, Device: DeviceAPI,
sourcepub fn new() -> SwapChains<SwapChainID, Device>
pub fn new() -> SwapChains<SwapChainID, Device>
Create a new collection.
sourcepub fn create_attached_swap_chain(
&self,
id: SwapChainID,
device: &mut Device,
context: &mut Device::Context,
surface_access: SurfaceAccess
) -> Result<(), Error>
pub fn create_attached_swap_chain( &self, id: SwapChainID, device: &mut Device, context: &mut Device::Context, surface_access: SurfaceAccess ) -> Result<(), Error>
Create a new attached swap chain and insert it in the table.
Returns an error if the id
is already in the table.
sourcepub fn create_detached_swap_chain(
&self,
id: SwapChainID,
size: Size2D<i32>,
device: &mut Device,
context: &mut Device::Context,
surface_access: SurfaceAccess
) -> Result<(), Error>
pub fn create_detached_swap_chain( &self, id: SwapChainID, size: Size2D<i32>, device: &mut Device, context: &mut Device::Context, surface_access: SurfaceAccess ) -> Result<(), Error>
Create a new dettached swap chain and insert it in the table.
Returns an error if the id
is already in the table.
sourcepub fn destroy(
&self,
id: SwapChainID,
device: &mut Device,
context: &mut Device::Context
) -> Result<(), Error>
pub fn destroy( &self, id: SwapChainID, device: &mut Device, context: &mut Device::Context ) -> Result<(), Error>
Destroy a swap chain.
Called by the producer.
Returns an error if context
is not the producer context for the swap chain.
sourcepub fn destroy_all(
&self,
device: &mut Device,
context: &mut Device::Context
) -> Result<(), Error>
pub fn destroy_all( &self, device: &mut Device, context: &mut Device::Context ) -> Result<(), Error>
Destroy all the swap chains for a particular producer context. Called by the producer.
Trait Implementations§
source§impl<SwapChainID: Default + Eq + Hash, Device: Default + DeviceAPI> Default for SwapChains<SwapChainID, Device>
impl<SwapChainID: Default + Eq + Hash, Device: Default + DeviceAPI> Default for SwapChains<SwapChainID, Device>
source§fn default() -> SwapChains<SwapChainID, Device>
fn default() -> SwapChains<SwapChainID, Device>
Returns the “default value” for a type. Read more