mirror of
https://github.com/lisk77/comet.git
synced 2025-12-15 18:18:50 +00:00
feat(renderer): added scale_factor to the trait to allow checking for scale factors in the event loop
This commit is contained in:
parent
dd89d71565
commit
87f0233066
3 changed files with 32 additions and 7 deletions
|
|
@ -1,12 +1,15 @@
|
|||
use comet_colors::Color;
|
||||
use std::sync::Arc;
|
||||
use winit::dpi::PhysicalSize;
|
||||
use winit::window::Window;
|
||||
use comet_colors::Color;
|
||||
|
||||
pub trait Renderer: Sized + Send + Sync {
|
||||
fn new(window: Arc<Window>, clear_color: Option<impl Color>) -> Self;
|
||||
fn size(&self) -> PhysicalSize<u32>;
|
||||
fn resize(&mut self, new_size: winit::dpi::PhysicalSize<u32>);
|
||||
fn update(&mut self) -> f32;
|
||||
fn render(&mut self) -> Result<(), wgpu::SurfaceError>;
|
||||
}
|
||||
fn new(window: Arc<Window>, clear_color: Option<impl Color>) -> Self;
|
||||
fn size(&self) -> PhysicalSize<u32>;
|
||||
fn resize(&mut self, new_size: winit::dpi::PhysicalSize<u32>);
|
||||
fn scale_factor(&self) -> f64;
|
||||
fn set_scale_factor(&mut self, scale_factor: f64);
|
||||
fn update(&mut self) -> f32;
|
||||
fn render(&mut self) -> Result<(), wgpu::SurfaceError>;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue