pub fn new() -> Result<Self> {
        let mut window_surface = GlfwWindow::windowed("Draw2D", 1366, 768)?;
        window_surface.window.set_resizable(true);
        window_surface.window.set_key_polling(true);
        window_surface.window.set_size_polling(true);
        window_surface.window.set_scroll_polling(true);
        let (iw, ih) = window_surface.window.get_size();

        let mut graphics = Graphics::new(&window_surface)?;
        let world_layer = graphics.add_layer_to_bottom();
        let ui_layer = graphics.add_layer_to_top();

        Ok(Self {
            world_layer,
            ui_layer,
            camera: OrthoCamera::with_viewport(
                ih as f32,
                iw as f32 / ih as f32,
            ),
            graphics,
            window_surface,
        })
    }
/// Build a new instance of the application.
Build a new instance of the application.
Build a new instance of the application .
pub fn new() -> Result<Self> {
        let mut window_surface = GlfwWindow::windowed("Draw2D", 1366, 768)?;
        window_surface.window.set_resizable(true);
        window_surface.window.set_key_polling(true);
        window_surface.window.set_size_polling(true);
        window_surface.window.set_scroll_polling(true);
        let (iw, ih) = window_surface.window.get_size();
        let mut graphics = Graphics::new(&window_surface)?;
        let world_layer = graphics.add_layer_to_bottom();
        let ui_layer = graphics.add_layer_to_top();
        Ok(Self {
            world_layer,
            ui_layer,
            camera: OrthoCamera::with_viewport(
                ih as f32,
                iw as f32 / ih as f32,
            ),
            graphics,
            window_surface,
        })
    }
pub fn new ( ) -> Result < Self > { let mut window_surface = GlfwWindow :: windowed ( " " , 1366 , 768 ) ? ; window_surface . window . set_resizable ( true ) ; window_surface . window . set_key_polling ( true ) ; window_surface . window . set_size_polling ( true ) ; window_surface . window . set_scroll_polling ( true ) ; let ( iw , ih ) = window_surface . window . get_size ( ) ; let mut graphics = Graphics :: new ( & window_surface ) ? ; let world_layer = graphics . add_layer_to_bottom ( ) ; let ui_layer = graphics . add_layer_to_top ( ) ; Ok ( Self { world_layer , ui_layer , camera : OrthoCamera :: with_viewport ( ih as f32 , iw as f32 / ih as f32 , ) , graphics , window_surface , } ) }
Build a new instance of the application.
Build a new instance of the application .