turnage / valora

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

'gl function was not loaded' in example code #51

Open mlakewood opened 4 years ago

mlakewood commented 4 years ago

Hi,

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.

Thanks

turnage commented 4 years ago

I don't have access to Mac OS so I can't look into this, but there is an issue open for it on glium.

https://github.com/glium/glium/issues/1840

mlakewood commented 4 years ago

I have submitted a really bad and terrible PR that somebody might be able to make better here -> https://github.com/glium/glium/pull/1846. This is more of a "this is where it breaks fix" so if you have any input it would be greatly appreciated.

virtualritz commented 4 years ago

Not sure if this is really a fix. For me it prevents the panic on init but with both simple and diamonds examples all I get is a black window.

holmrenser commented 3 years ago

Experiencing the same issue, this makes valora unusable on mac.

wbrickner commented 3 years ago

Experiencing this issue, Valora looks amazing but has been broken on macos for 8+ months.

virtualritz commented 3 years ago

As Payton said, this is upstream. We're barking up the wrong tree here.