How do I set the window position in the GGEZ game crate?

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);
    } else {
    /* #endregion */

    let cb = ggez::ContextBuilder::new("super_simple with imgui", "ggez")
        .window_setup(conf::WindowSetup::default().title("super_simple with imgui"))

    let (ref mut ctx, event_loop) = &mut;

    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)

The window does not appear to be available from ggez, since it's stored inside the GraphicsContext and that is not exposed in the public ggez Context API. You may want to file an issue in about making it possible to set or adjust the window position.

I finally found a way to set the position of the ggez window!

    // Set window position here   
    let (ref mut ctx, event_loop) = &mut; 
    let window = graphics::window(ctx);    
    let mut pos = window.get_position().unwrap();   
    pos.x = 0.0;    
    pos.y = 0.0;    

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.