I've looked at the docs, but can't see a way to do this.
It seems winit::Window::set_position()
is the way to go (winit and glutin being the same thing), but I can't see how to get a reference to winit::Window
.
Here's the code that produces a window and game loop:
pub fn main() -> ggez::GameResult {
/* #region Establish access to resources folder */
let resource_dir = if let Ok(manifest_dir) = env::var("CARGO_MANIFEST_DIR") {
let mut path = path::PathBuf::from(manifest_dir);
path.push("resources");
path
} else {
path::PathBuf::from("./resources")
};
/* #endregion */
let cb = ggez::ContextBuilder::new("super_simple with imgui", "ggez")
.add_resource_path(resource_dir)
.window_setup(conf::WindowSetup::default().title("super_simple with imgui"))
.window_mode(
conf::WindowMode::default().resizable(true).maximized(true),
);
let (ref mut ctx, event_loop) = &mut cb.build()?;
let hidpi_factor = event_loop.get_primary_monitor().get_hidpi_factor() as f32;
println!("main hidpi_factor = {}", hidpi_factor);
let state = &mut MainState::new(ctx, hidpi_factor)?;
event::run(ctx, event_loop, state)
}