rugra icon indicating copy to clipboard operation
rugra copied to clipboard

Example does not work

Open eterps opened this issue 6 years ago • 0 comments

Sorry if I'm missing the obvious: I suppose I need to cargo run --example simple.

Which results in:

warning: unused variable: `font`
  --> examples/simple.rs:10:9
   |
10 |     let font = Font::load("assets/font.ttf");
   |         ^^^^ help: consider using `_font` instead
   |
   = note: #[warn(unused_variables)] on by default

warning: variable does not need to be mutable
 --> examples/simple.rs:8:9
  |
8 |     let mut x = 10.0;
  |         ----^
  |         |
  |         help: remove this `mut`
  |
  = note: #[warn(unused_mut)] on by default

    Finished dev [unoptimized + debuginfo] target(s) in 8.94s
     Running `target/debug/examples/simple`
Failed to load font "" (failed to create the font face)
thread 'main' panicked at 'Couldn't load font', libcore/option.rs:960:5

After fixing the warnings you get:

cargo run --example simple
   Compiling rugra v0.1.0 (file:///Users/erik/Downloads/tmp/rugra)
    Finished dev [unoptimized + debuginfo] target(s) in 0.62s
     Running `target/debug/examples/simple`
Warning. OpenGL debugging not supported on this platform.
Warning: The created OpenGL context does not fully meet the settings that were requested
Requested: version = 2.0 ; depth bits = 0 ; stencil bits = 0 ; AA level = 0 ; core = false ; debug = true ; sRGB = false
Created: version = 2.1 ; depth bits = 0 ; stencil bits = 0 ; AA level = 0 ; core = false ; debug = false ; sRGB = false
Failed to load image "". Reason: Unable to open file
thread 'main' panicked at 'Couldn't load sprite', libcore/option.rs:960:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

I tried again specifying the full path to the sprite, but that resulted in the same error as above.

eterps avatar Jul 10 '18 11:07 eterps