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)>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl SurfaceFrame for AppSurface
Available on neither (Linux, or Windows, or macOS and non-crate feature
mac_catalyst) and non-crate feature winit, nor WebAssembly and non-crate feature web_rwh and non-crate feature winit.