Skip to content

Examples run on v0.4.0 but not on master, master builds but 0.4.0 does not. #243

@dvogel

Description

@dvogel

If I build the examples from v0.4.0 I can run the aviator example. When I build 07e47da (current tip of the master branch) the examples build but the window opens and is automatically closed immediately. The same is true if I compile and run a basic program based on the introductory instructions:

extern crate three;

use three::{Factory, Object, template::Template};

fn main() {
    let title = "MyGame";
    let mut window = three::Window::new(title);

    let center = [0.0, 0.0];
    let yextent = 1.0;
    let zrange = -1.0 .. 1.0;
    let camera = window.factory.orthographic_camera(center, yextent, zrange);

    while window.update() {
        window.render(&camera);
    }
}

It seems window.update() returns false as soon as the window appears on screen. Unfortunately the three-rs v0.4.0 depends on gltf v0.11.3, which does not compile when I enable the feature:

error[E0597]: `buf` does not live long enough
   --> /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/gltf-0.11.3/src/binary.rs:225:35
    |
119 | impl<'a> Glb<'a> {
    |      -- lifetime `'a` defined here
...
225 |                     Self::from_v2(&buf)
    |                     --------------^^^^-
    |                     |             |
    |                     |             borrowed value does not live long enough
    |                     argument requires that `buf` is borrowed for `'a`
...
233 |             }
    |             - `buf` dropped here while still borrowed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0597`.
error: could not compile `gltf`.

Git bisect points at commit 57b2ba8 as when the aviator example broke on my system (linux, x11) but I haven't had time to dig into it yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions