diff --git a/src/core.rs b/src/core.rs index d5e2ab9..5369619 100644 --- a/src/core.rs +++ b/src/core.rs @@ -1,4 +1,3 @@ -use config::Config; use breakout::GlutinBreakout; use rustic_gl; @@ -20,14 +19,19 @@ use gl::types::*; use std::ptr::null; /// Create a context using glutin given a configuration. -pub fn init_glutin_context(config: &Config) -> (EventsLoop, GlWindow) { - let window_size = LogicalSize::new(config.window_size.0, config.window_size.1); +pub fn init_glutin_context( + window_title: S, + window_width: f64, + window_height: f64, + resizable: bool, +) -> (EventsLoop, GlWindow) { + let window_size = LogicalSize::new(window_width, window_height); let events_loop = EventsLoop::new(); let window = WindowBuilder::new() - .with_title(config.window_title.to_string()) + .with_title(window_title.to_string()) .with_dimensions(window_size) - .with_resizable(config.resizable); + .with_resizable(resizable); let context = ContextBuilder::new(); let gl_window = GlWindow::new(window, context, &events_loop).unwrap(); diff --git a/src/lib.rs b/src/lib.rs index cbc7887..f19acde 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -110,7 +110,12 @@ pub fn get_fancy(config: Config) -> MiniGlFb { let buffer_height = if config.buffer_size.1 == 0 { config.window_size.1.round() as _ } else { config.buffer_size.1 }; - let (events_loop, gl_window) = core::init_glutin_context(&config); + let (events_loop, gl_window) = core::init_glutin_context( + config.window_title, + config.window_size.0, + config.window_size.1, + config.resizable, + ); let dpi_factor = gl_window.get_hidpi_factor(); let (vp_width, vp_height) = gl_window.get_inner_size()