Skip to content

Can't initialise window on Windows #270

Description

@RotatingSand

I couldn't get turtle.rs to work in my project, so I tried testing it in a new project and the turtle will not start.
Here is all of the code in the main bin, copied from the website.

use turtle::Turtle;

fn main.rs() {
    let mut my_turtle = Turtle::new();

    for _ in 0..360 {
        my_turt.forward(1.0);
        my_turt.right(1.0);
    }
}

When compiled and run, it throws the error

attempted to zero-initialize type `glutin::windowed::ContextWrapper<glutin::context::PossiblyCurrent, winit::Window>`, which is invalid

Rust backtrace show this occurs in line 126 of renderer.rs, in Renderer::run, called in server::main from the turtle::start command.
(This method is labeled piston_window::PistonWindow<glutin_window::GlutinWindow>::draw_2d< ... > (????))

window.draw_2d(&event, |c, g, _d| { /* ... */ });

Which calls glutin_window::impl$4::make_current, calling the win32 implementation of glutin.
For some reason this is a zero-initialise. After looking into it this seems to be an issue with Piston or Glutin's implementations, but it still bricks this turtle library.
(Also, rust backtrace shows this is an issue with glutin window, but piston uses winit windows, which might also use glutin windows, so its hard to tell whats at fault)
(((I have no clue what I'm doing I've forgotten how to use github)))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions