Im trying to run the example code from the first step of the book. This is my code
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)));
})
})
}
This is running on OS X 10.14.6.
[plat-us1] 3718:~/projects/generative_art mlakewood$ rustup show
Default host: x86_64-apple-darwin
rustup home: /Users/mlakewood/.rustup
installed toolchains
--------------------
stable-x86_64-apple-darwin
nightly-x86_64-apple-darwin
active toolchain
----------------
stable-x86_64-apple-darwin (default)
rustc 1.43.1 (8d69840ab 2020-05-04)
and im getting this error.
Compiling generative_art v0.1.0 (/Users/mlakewood/projects/generative_art)
Finished release [optimized] target(s) in 15.89s
Running `target/release/generative_art`
thread 'main' panicked at 'gl function was not loaded', /Users/mlakewood/projects/generative_art/target/release/build/glium-a14cc260c59976e8/out/gl_bindings.rs:2535:13
stack backtrace:
0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
1: core::fmt::write
2: std::io::Write::write_fmt
3: std::panicking::default_hook::{{closure}}
4: std::panicking::default_hook
5: std::panicking::rust_panic_with_hook
6: std::panicking::begin_panic
7: glium::gl::missing_fn_panic
8: glium::texture::any::new_texture
9: valora::gpu::Gpu::build_texture
10: valora::run_fn
11: generative_art::main
12: std::rt::lang_start::{{closure}}
13: std::panicking::try::do_call
14: __rust_maybe_catch_panic
15: std::rt::lang_start_internal
16: main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Any ideas where I should be looking.