You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have gotten to the point in my project where I have everything set up to draw a GUI using piston_window as a backend. At first I noticed nothing drew to the screen. I have widgets being successfully created on event.update inside the while let Some(event) = window.next() loop, though I realised the GUI itself is not being drawn inside the window.draw_2d function.
I'm not entirely sure if this is correct as I'm looking at code from the all_piston_window.rs example, but I also need to include a conrod::backend::piston::draw::primitives() function inside of the draw function mentioned earlier, but no matter what I put after conrod::backend (including piston, piston_window, winit and glium) I get an error compiling every time saying "Could not find `piston` in `backend`". I've checked the source - it's all right there, but it just doesn't seem to get picked up by the compiler?
I have tried adding --features "piston" to cargo run but it still fails on me. I have these libraries in my dependencies in order to get everything running fine, apart from this single error.
Hey @TomboFry, --features "piston" will only work when trying to run or compile conrod or its examples directly. If you'd like to activate the piston feature when using conrod as a dependency, the conrod entry under your [dependencies] list should look like this:
conrod = { version = "^0.51.1", features = "piston" }
Ahhhh, yes, that makes complete sense! I noticed in the backend/mod.rs file it has #[cfg(feature="piston")] so I knew it would go somewhere, but I did not consider the config file as you suggested.
I got it working by turning features = "piston" into an array, thank you very much for the help.
I have gotten to the point in my project where I have everything set up to draw a GUI using piston_window as a backend. At first I noticed nothing drew to the screen. I have widgets being successfully created on
event.update
inside thewhile let Some(event) = window.next()
loop, though I realised the GUI itself is not being drawn inside thewindow.draw_2d
function.I'm not entirely sure if this is correct as I'm looking at code from the all_piston_window.rs example, but I also need to include a
conrod::backend::piston::draw::primitives()
function inside of the draw function mentioned earlier, but no matter what I put afterconrod::backend
(including piston, piston_window, winit and glium) I get an error compiling every time saying "Could not find `piston` in `backend`". I've checked the source - it's all right there, but it just doesn't seem to get picked up by the compiler?I have tried adding
--features "piston"
tocargo run
but it still fails on me. I have these libraries in my dependencies in order to get everything running fine, apart from this single error.Is there something I'm missing? I can provide more source code if necessary, though it's quite similar to the example I linked to above.
The text was updated successfully, but these errors were encountered: