pub struct Window<'a> { /* private fields */ }
Expand description
Represents a window
Implementations§
Source§impl Window<'_>
impl Window<'_>
Sourcepub fn new<'a>(
event_loop: &mut EventLoop<'a>,
pipeline: Arc<Mutex<dyn RenderPipeline>>,
event_handler: Box<dyn EventHandler>,
) -> Arc<Mutex<Window<'a>>>
pub fn new<'a>( event_loop: &mut EventLoop<'a>, pipeline: Arc<Mutex<dyn RenderPipeline>>, event_handler: Box<dyn EventHandler>, ) -> Arc<Mutex<Window<'a>>>
Creates a new window, the title can be set by calling Window::set_title
Sourcepub fn get_handle(&self) -> &Window
pub fn get_handle(&self) -> &Window
Returns the underlying winit window handle
Sourcepub fn get_window_id(&self) -> WindowId
pub fn get_window_id(&self) -> WindowId
Returns the window id
Sourcepub fn set_size(&mut self, size: PhysicalSize<u32>)
pub fn set_size(&mut self, size: PhysicalSize<u32>)
Resize the window. This might fail silently
Sourcepub fn set_position(&mut self, position: PhysicalPosition<i32>)
pub fn set_position(&mut self, position: PhysicalPosition<i32>)
Sets the position of the window
Sourcepub fn set_fullscreen(&mut self, fullscreen: Option<Fullscreen>)
pub fn set_fullscreen(&mut self, fullscreen: Option<Fullscreen>)
Sets the window to fullscreen
Sourcepub fn set_cursor_visible(&mut self, visible: bool)
pub fn set_cursor_visible(&mut self, visible: bool)
Sets the visibility of the cursor
Sourcepub fn get_render_pipeline(&self) -> Arc<Mutex<dyn RenderPipeline>>
pub fn get_render_pipeline(&self) -> Arc<Mutex<dyn RenderPipeline>>
Returns the taika RenderPipeline
Sourcepub fn get_target_properties(&self) -> &TargetProperties
pub fn get_target_properties(&self) -> &TargetProperties
Returns the TargetProperties
of this window
Auto Trait Implementations§
impl<'a> !Freeze for Window<'a>
impl<'a> !RefUnwindSafe for Window<'a>
impl<'a> !Send for Window<'a>
impl<'a> !Sync for Window<'a>
impl<'a> Unpin for Window<'a>
impl<'a> !UnwindSafe for Window<'a>
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.