pub trait SurfaceFrame {
// Required methods
fn view_size(&self) -> ViewSize;
fn resize_surface(&mut self);
fn resize_surface_by_size(&mut self, size: (u32, u32));
// Provided methods
fn pintch(&mut self, _touch: Touch, _scale: f32) { ... }
fn touch(&mut self, _touch: Touch) { ... }
fn normalize_touch_point(
&self,
_touch_point_x: f32,
_touch_point_y: f32,
) -> (f32, f32) { ... }
fn enter_frame(&mut self) { ... }
fn get_current_frame_view(
&self,
_view_format: Option<TextureFormat>,
) -> Option<(SurfaceTexture, TextureView)> { ... }
fn create_current_frame_view(
&self,
device: &Device,
surface: &Surface<'_>,
config: &SurfaceConfiguration,
view_format: Option<TextureFormat>,
) -> Option<(SurfaceTexture, TextureView)> { ... }
}Required Methods§
fn view_size(&self) -> ViewSize
fn resize_surface(&mut self)
fn resize_surface_by_size(&mut self, size: (u32, u32))
Provided Methods§
fn pintch(&mut self, _touch: Touch, _scale: f32)
fn touch(&mut self, _touch: Touch)
fn normalize_touch_point( &self, _touch_point_x: f32, _touch_point_y: f32, ) -> (f32, f32)
fn enter_frame(&mut self)
fn get_current_frame_view( &self, _view_format: Option<TextureFormat>, ) -> Option<(SurfaceTexture, TextureView)>
fn create_current_frame_view( &self, device: &Device, surface: &Surface<'_>, config: &SurfaceConfiguration, view_format: Option<TextureFormat>, ) -> Option<(SurfaceTexture, TextureView)>
Implementors§
impl SurfaceFrame for AppSurface
Available on neither non-crate feature
winit and (non-crate feature mac_catalyst and macOS, or Windows, or Linux), nor WebAssembly and non-crate feature winit and non-crate feature web_rwh.