Something went wrong. Try again.
A new game engine written in rust meant to be used in other personal projects
Something went wrong. Try again.
12345678910111213141516171819202122232425use winit::{ dpi::PhysicalSize, error::OsError, window::{Window, WindowId},};
#[derive(Debug)]pub struct WindowContext { window: Window, size: PhysicalSize<u32>,}
impl WindowContext { #[must_use] pub fn new(event_loop: &winit::event_loop::ActiveEventLoop) -> Result<Self, OsError> { let window = event_loop.create_window(Window::default_attributes())?; let size = window.inner_size(); Ok(Self { window, size }) }
pub fn id(&self) -> WindowId { self.window.id() }}