turnage / valora

painting by functions
https://paytonturnage.gitbook.io/valora/
MIT License
702 stars 30 forks source link

The first example in the docs does not work #53

Closed ghost closed 3 years ago

ghost commented 3 years ago

I have copied the instructions to a tee, copy and pasted everything;

cargo new art --bin && cd art
cargo install cargo-edit && cargo add valora
// in main.rs...
use valora::prelude::*;

fn main() -> Result<()> {
    run_fn(Options::from_args(), |_gpu, world, _rng| {
        Ok(move |ctx: Context, canvas: &mut Canvas| {
            canvas.set_color(LinSrgb::new(1., 1., 1.));
            canvas.paint(Filled(ctx.world));

            let max_radius = world.width / 3.;
            let radius = ctx.time.as_secs_f32().cos().abs() * max_radius;

            canvas.set_color(LinSrgb::new(1., 0., 0.));
            canvas.paint(Filled(Ellipse::circle(world.center(), radius)));
        })
    })
}

When run, with cargo run --release, it gives me a window entirely in black.

Said window

ghost commented 3 years ago

Apparently this also affects literally all the other examples I've found.