This commit is contained in:
parent
e9ce480f96
commit
210a5504ab
6 changed files with 162 additions and 90 deletions
|
@ -1,4 +1,5 @@
|
|||
use std::ffi::c_char;
|
||||
use winit::dpi::Pixel;
|
||||
use winit::event_loop::ActiveEventLoop;
|
||||
use winit::raw_window_handle::HasDisplayHandle;
|
||||
|
||||
|
@ -49,8 +50,10 @@ impl Window {
|
|||
self.handle.as_ref()
|
||||
}
|
||||
|
||||
pub fn size(&self) -> Option<winit::dpi::Size> {
|
||||
self.window_attributes.inner_size
|
||||
pub fn physical_size<P: Pixel>(&self) -> Option<winit::dpi::PhysicalSize<P>> {
|
||||
self.window_attributes
|
||||
.inner_size
|
||||
.and_then(|size| Some(size.to_physical::<P>(1.0)))
|
||||
}
|
||||
|
||||
pub fn request_redraw(&self) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue