rendy_wsi

Struct Surface

Source
pub struct Surface<B: Backend> { /* private fields */ }
Expand description

Rendering target bound to window.

Implementations§

Source§

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

Source

pub fn instance_id(&self) -> InstanceId

Get owned id.

Source

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

Assert specified instance is owner.

Source§

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

Source

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

Create surface for the window.

Source

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

Create surface from instance.

§Safety

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

Source

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

Create surface from raw parts.

Source§

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

Source

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

Get raw B::Surface reference

Source

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

Get current extent of the surface.

Source

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

Get surface ideal format.

Source

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

Get formats supported by surface

§Safety
  • physical_device must be created from same Instance as the Surface
Source

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

Get formats supported by surface

§Safety
  • physical_device must be created from same Instance as the Surface
Source

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>

Cast surface into render target.

Trait Implementations§

Source§

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

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<B> Freeze for Surface<B>
where <B as Backend>::Surface: Freeze,

§

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

§

impl<B> Send for Surface<B>

§

impl<B> Sync for Surface<B>

§

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

§

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

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.