pub struct Window { /* private fields */ }Expand description
Default window and event handler for easy setup.
Implementations§
source§impl Window
impl Window
sourcepub fn new(settings: WindowSettings) -> Result<Window, WindowError>
pub fn new(settings: WindowSettings) -> Result<Window, WindowError>
Constructs a new window with the given settings.
sourcepub fn render_loop<F: 'static + FnMut(FrameInput) -> FrameOutput>(
self,
callback: F
)
pub fn render_loop<F: 'static + FnMut(FrameInput) -> FrameOutput>( self, callback: F )
Start the main render loop which calls the callback closure each frame.
sourcepub fn viewport(&self) -> Viewport
pub fn viewport(&self) -> Viewport
Returns the current viewport of the window in physical pixels (the size of the screen RenderTarget which is returned from FrameInput::screen).