SurfaceRenderer

Struct SurfaceRenderer 

Source
pub struct SurfaceRenderer<'s> {
    pub dev_id: usize,
    pub device_handle: DeviceHandle,
    pub surface: Surface<'s>,
    pub config: SurfaceConfiguration,
    /* private fields */
}
Expand description

Combination of surface and its configuration.

Fields§

§dev_id: usize§device_handle: DeviceHandle§surface: Surface<'s>§config: SurfaceConfiguration

Implementations§

Source§

impl<'s> SurfaceRenderer<'s>

Source

pub async fn new<'w>( surface: Surface<'w>, surface_renderer_config: SurfaceRendererConfiguration, intermediate_texture_config: Option<TextureConfiguration>, device_handle: DeviceHandle, dev_id: usize, ) -> Result<SurfaceRenderer<'w>, WgpuContextError>

Creates a new render surface for the specified window and dimensions.

Source

pub fn device(&self) -> &Device

Source

pub fn queue(&self) -> &Queue

Source

pub fn resize(&mut self, width: u32, height: u32)

Resizes the surface to the new dimensions.

Source

pub fn set_present_mode(&mut self, present_mode: PresentMode)

Source

pub fn current_surface_texture(&self) -> SurfaceTexture

Source

pub fn target_texture_view(&self) -> TextureView

Source

pub fn maybe_blit_and_present(&self)

Trait Implementations§

Source§

impl Debug for SurfaceRenderer<'_>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'s> !Freeze for SurfaceRenderer<'s>

§

impl<'s> !RefUnwindSafe for SurfaceRenderer<'s>

§

impl<'s> Send for SurfaceRenderer<'s>

§

impl<'s> Sync for SurfaceRenderer<'s>

§

impl<'s> Unpin for SurfaceRenderer<'s>

§

impl<'s> !UnwindSafe for SurfaceRenderer<'s>

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.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,