[][src]Struct rendy_wsi::Surface

pub struct Surface<B: Backend> { /* fields omitted */ }

Rendering target bound to window.

Methods

impl<B> Surface<B> where
    B: Backend, 

pub fn instance_id(&self) -> InstanceId

Get owned id.

pub fn assert_instance_owner(&self, instance: &Instance<B>)

Assert specified instance is owner.

impl<B> Surface<B> where
    B: Backend, 
[src]

pub fn new(
    instance: &Instance<B>,
    handle: &impl HasRawWindowHandle
) -> Result<Self, InitError>
[src]

Create surface for the window.

pub unsafe fn new_with(
    instance: &Instance<B>,
    f: impl FnOnce(&B::Instance) -> B::Surface
) -> Self
[src]

Create surface from instance.

Safety

Closure must return surface object created from raw instance provided as closure argument.

pub unsafe fn from_raw(surface: B::Surface, instance: InstanceId) -> Self[src]

Create surface from raw parts.

impl<B> Surface<B> where
    B: Backend, 
[src]

pub fn raw(&self) -> &B::Surface[src]

Get raw B::Surface reference

pub unsafe fn extent(
    &self,
    physical_device: &B::PhysicalDevice
) -> Option<Extent2D>
[src]

Get current extent of the surface.

pub unsafe fn format(&self, physical_device: &B::PhysicalDevice) -> Format[src]

Get surface ideal format.

pub unsafe fn supported_formats(
    &self,
    physical_device: &B::PhysicalDevice
) -> Option<Vec<Format>>
[src]

Get formats supported by surface

Safety

  • physical_device must be created from same Instance as the Surface

pub unsafe fn capabilities(
    &self,
    physical_device: &B::PhysicalDevice
) -> SurfaceCapabilities
[src]

Get formats supported by surface

Safety

  • physical_device must be created from same Instance as the Surface

pub unsafe fn into_target(
    self,
    physical_device: &B::PhysicalDevice,
    device: &Device<B>,
    suggest_extent: Extent2D,
    image_count: u32,
    present_mode: PresentMode,
    usage: Usage
) -> Result<Target<B>, SwapchainError>
[src]

Cast surface into render target.

Trait Implementations

impl<B> Debug for Surface<B> where
    B: Backend, 
[src]

Auto Trait Implementations

impl<B> Send for Surface<B> where
    <B as Backend>::Surface: Send

impl<B> Sync for Surface<B> where
    <B as Backend>::Surface: Sync

impl<B> Unpin for Surface<B> where
    <B as Backend>::Surface: Unpin

impl<B> UnwindSafe for Surface<B> where
    <B as Backend>::Surface: UnwindSafe

impl<B> RefUnwindSafe for Surface<B> where
    <B as Backend>::Surface: RefUnwindSafe

Blanket Implementations

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

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

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.

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

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

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