Struct g2d::WindowHandle
source · pub struct WindowHandle { /* private fields */ }
Expand description
A Handle to the G2d API which is initialized for a specific window.
Implementations§
source§impl WindowHandle
impl WindowHandle
sourcepub async fn new<W: HasRawDisplayHandle + HasRawWindowHandle>(
window: &W,
surface_size: Dimension
) -> Result<Self, Error>
pub async fn new<W: HasRawDisplayHandle + HasRawWindowHandle>( window: &W, surface_size: Dimension ) -> Result<Self, Error>
Attempts to create a WindowHandle for the provided window.
The provided size should be the current size of the window’s surface.
sourcepub fn wgpu_surface(&self) -> &Surface
pub fn wgpu_surface(&self) -> &Surface
Returns the wgpu::Surface
this WindowHandle uses.
sourcepub fn resize_surface(&mut self, new_size: Dimension)
pub fn resize_surface(&mut self, new_size: Dimension)
Resizes the surface of this WindowHandle.
Should be called when the window’s manager emits a resize event. Does nothing if the new size is zero.
Trait Implementations§
source§impl Debug for WindowHandle
impl Debug for WindowHandle
source§impl Handle for WindowHandle
impl Handle for WindowHandle
source§fn wgpu_device(&self) -> &Device
fn wgpu_device(&self) -> &Device
The
wgpu::Device
this Handle uses.source§fn wgpu_queue(&self) -> &Queue
fn wgpu_queue(&self) -> &Queue
The
wgpu::Queue
this Handle uses.source§fn make_blank_texture(&self, size: Dimension) -> OwnedTexture<'_, Self>
fn make_blank_texture(&self, size: Dimension) -> OwnedTexture<'_, Self>
source§fn make_texture(
&self,
size: Dimension,
data: &[u8]
) -> Result<OwnedTexture<'_, Self>, Error>
fn make_texture( &self, size: Dimension, data: &[u8] ) -> Result<OwnedTexture<'_, Self>, Error>
Auto Trait Implementations§
impl !RefUnwindSafe for WindowHandle
impl Send for WindowHandle
impl Sync for WindowHandle
impl Unpin for WindowHandle
impl !UnwindSafe for WindowHandle
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more