diff --git a/src/main.rs b/src/main.rs index 76e53fd..8e7c1f3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -212,6 +212,7 @@ fn run_presentation( let mut renderer = Renderer::new( &event_loop, window_builder, + |window| window.set_cursor_visible(false), font, foreground_colour, background_colour, diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index a80ffa2..c7e2921 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -110,14 +110,18 @@ pub struct Renderer<'a> { } impl<'a> Renderer<'a> { - pub fn new( + pub fn new( event_loop: &EventLoop<()>, window_builder: WindowBuilder, + additional_window_configuration: F, font: FontArc, foreground_colour: LinearRgbaColour, background_colour: LinearRgbaColour, image_cache: HashMap<&'a String, DynamicImage>, - ) -> AnyhowResult { + ) -> AnyhowResult + where + F: FnOnce(&Window), + { // I wanted to implement the renderer initialisation myself, but the myriad ways // to do it without any consistency or documentation led me to just use the same // approach that the `glyph_brush` examples use. Perhaps this can be revisited @@ -137,6 +141,8 @@ impl<'a> Renderer<'a> { .map_err(|error| anyhow!(error.to_string())) .with_context(|| "unable to build the window")?; + additional_window_configuration(&window); + let encoder = factory.create_command_buffer().into(); let glyph_brush = GlyphBrushBuilder::using_font(font).build(factory.clone());