Coder Social home page Coder Social logo

Comments (5)

bvssvni avatar bvssvni commented on June 2, 2024

The examples works fine on OSX. This is a 2D graphics backend for Glium, so there is not much documentation here. If you are new to Piston I recommend looking at the overview first.

You probably need to install FreeType to make the examples work. See How to install FreeType.

from glium_graphics.

iirelu avatar iirelu commented on June 2, 2024

Here's what I get when I try compiling draw_state.rs:

src/main.rs:29:28: 29:44 error: the trait `window::OpenGLWindow` is not implemented for the type `glutin_window::GlutinWindow` [E0277]
src/main.rs:29     let ref glium_window = GliumWindow::new(window).unwrap();
                                          ^~~~~~~~~~~~~~~~
src/main.rs:29:28: 29:44 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:29:28: 29:44 note: required by `glium_graphics::window::GliumWindow::new`
src/main.rs:50:19: 50:35 error: no method named `clear_stencil` found for type `&mut glium_graphics::back_end::GliumGraphics<'_, '_, glium::Frame>` in the current scope
src/main.rs:50                 g.clear_stencil(0);
                                 ^~~~~~~~~~~~~~~~
src/main.rs:50:19: 50:35 help: items from traits can only be used if the trait is in scope; the following trait is implemented but not in scope, perhaps add a `use` for it:
src/main.rs:50:19: 50:35 help: candidate #1: use `graphics::graphics::Graphics`
src/main.rs:49:17: 49:22 error: the trait `graphics::graphics::Graphics` is not implemented for the type `glium_graphics::back_end::GliumGraphics<'_, '_, glium::Frame>` [E0277]
src/main.rs:49                 clear([0.8, 0.8, 0.8, 1.0], g);
                               ^~~~~
src/main.rs:49:17: 49:22 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:49:17: 49:22 note: required by `graphics::clear`
src/main.rs:52:22: 52:83 error: the trait `graphics::graphics::Graphics` is not implemented for the type `glium_graphics::back_end::GliumGraphics<'_, '_, glium::Frame>` [E0277]
src/main.rs:52                     .draw([0.0, 0.0, 100.0, 100.0], &c.draw_state, c.transform, g);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:52:22: 52:83 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:56:22: 56:83 error: the trait `graphics::graphics::Graphics` is not implemented for the type `glium_graphics::back_end::GliumGraphics<'_, '_, glium::Frame>` [E0277]
src/main.rs:56                     .draw([50.0, 50.0, 100.0, 100.0], &draw_state, c.transform, g);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:56:22: 56:83 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:64:30: 64:70 error: the trait `graphics::graphics::Graphics` is not implemented for the type `glium_graphics::back_end::GliumGraphics<'_, '_, glium::Frame>` [E0277]
src/main.rs:64                 Image::new().draw(&rust_logo, &clipped, transform, g);
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:64:30: 64:70 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:68:22: 68:83 error: the trait `graphics::graphics::Graphics` is not implemented for the type `glium_graphics::back_end::GliumGraphics<'_, '_, glium::Frame>` [E0277]
src/main.rs:68                     .draw([0.0, 0.0, 50.0, 50.0], clip_draw_state(), transform, g);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:68:22: 68:83 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:69:30: 72:34 error: the trait `graphics::graphics::Graphics` is not implemented for the type `glium_graphics::back_end::GliumGraphics<'_, '_, glium::Frame>` [E0277]
src/main.rs:69                 Image::new().draw(&rust_logo,
src/main.rs:70                     if clip_inside { inside_draw_state() }
src/main.rs:71                     else { outside_draw_state() },
src/main.rs:72                     transform, g);
src/main.rs:69:30: 72:34 help: run `rustc --explain E0277` to see a detailed explanation
error: aborting due to 8 previous errors
Could not compile `space`.

from glium_graphics.

mitchmindtree avatar mitchmindtree commented on June 2, 2024

Hi @iirelu 😸 Are you sure you're using the latest version of glium_graphics? If you haven't already, perhaps try doing a cargo update to ensure you have the latest version of the dependencies as well. It's strange you're getting compile errors when travis seems to be passing without problems 😕

from glium_graphics.

iirelu avatar iirelu commented on June 2, 2024

Huh. Could've sworn I tried that.

I should probably report a bug to rust-lang about those error messages being weird as hell. I spent a whole week trying to figure out why it said OpenGLWindow wasn't implemented for GlutinWindow, I guess it's because its two different versions or something? Weird.

Thanks though! This finally gives me a standing point to get things working from.

from glium_graphics.

mitchmindtree avatar mitchmindtree commented on June 2, 2024

@iirelu yeah you're not the first to come across that problem! The only reason I knew to recommend that solution is because I've run into it too many times myself. I believe there has been discussion on providing warnings for version conflicts (I think perhaps in the rust-lang/crates.io issues?) but I don't have time to check atm.

Anyway, glad you got it working! 👍

from glium_graphics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.