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);

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

        let font_bytes = include_bytes!(
            "../../assets/Architects_Daughter/ArchitectsDaughter-Regular.ttf"
        );
        let font =
            ab_glyph::FontArc::try_from_slice(font_bytes)?.into_scaled(64.0);
        let title_renderer = TextRenderer::new(font, &mut graphics)?;

        let font_bytes =
            include_bytes!("../../assets/Montserrat/Montserrat-Regular.ttf");
        let font =
            ab_glyph::FontArc::try_from_slice(font_bytes)?.into_scaled(32.0);
        let body_renderer = TextRenderer::new(font, &mut graphics)?;

        // Solarized, base3
        graphics.clear_color =
            [227.0 / 255.0, 221.0 / 255.0, 204.0 / 255.0, 1.0];

        Ok(Self {
            graphics,
            window_surface,
            world_layer,
            title_renderer,
            body_renderer,
        })
    }
/// 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);
        let mut graphics = Graphics::new(&window_surface)?;
        let world_layer = graphics.add_layer_to_bottom();
        let font_bytes = include_bytes!(
            "../../assets/Architects_Daughter/ArchitectsDaughter-Regular.ttf"
        );
        let font =
            ab_glyph::FontArc::try_from_slice(font_bytes)?.into_scaled(64.0);
        let title_renderer = TextRenderer::new(font, &mut graphics)?;
        let font_bytes =
            include_bytes!("../../assets/Montserrat/Montserrat-Regular.ttf");
        let font =
            ab_glyph::FontArc::try_from_slice(font_bytes)?.into_scaled(32.0);
        let body_renderer = TextRenderer::new(font, &mut graphics)?;
        // Solarized, base3
        graphics.clear_color =
            [227.0 / 255.0, 221.0 / 255.0, 204.0 / 255.0, 1.0];
        Ok(Self {
            graphics,
            window_surface,
            world_layer,
            title_renderer,
            body_renderer,
        })
    }
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 ) ; let mut graphics = Graphics :: new ( & window_surface ) ? ; let world_layer = graphics . add_layer_to_bottom ( ) ; let font_bytes = include_bytes ! ( " " ) ; let font = ab_glyph :: FontArc :: try_from_slice ( font_bytes ) ? . into_scaled ( 64.0 ) ; let title_renderer = TextRenderer :: new ( font , & mut graphics ) ? ; let font_bytes = include_bytes ! ( " " ) ; let font = ab_glyph :: FontArc :: try_from_slice ( font_bytes ) ? . into_scaled ( 32.0 ) ; let body_renderer = TextRenderer :: new ( font , & mut graphics ) ? ; // Solarized, base3 graphics . clear_color = [ 227.0 / 255.0 , 221.0 / 255.0 , 204.0 / 255.0 , 1.0 ] ; Ok ( Self { graphics , window_surface , world_layer , title_renderer , body_renderer , } ) }
Build a new instance of the application.
Build a new instance of the application .