Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete glium.rs backend and update glutin_glium.rs example accordingly. #852

Merged
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ piston = ["piston2d-graphics", "pistoncore-window", "pistoncore-event_loop", "gf
"pistoncore-glutin_window", "piston-texture"]

[dev-dependencies]
find_folder = "0.3.0"
gfx = "0.12.0"
gfx_window_glutin = "0.12.0"
find_folder = "0.3.0"
image = "0.10.3"
rand = "0.3.13"
4 changes: 1 addition & 3 deletions examples/all_widgets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ fn main() {

// Create our `conrod::image::Map` which describes each of our widget->image mappings.
// In our case we only have one image, however the macro may be used to list multiple.
let image_map = image_map! {
(ids.rust_logo, load_rust_logo(&mut window.context)),
};
let image_map = support::image_map(&ids, load_rust_logo(&mut window.context));

// Poll events from the window.
while let Some(event) = events.next(&mut window) {
Expand Down
2 changes: 1 addition & 1 deletion examples/glutin_gfx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ mod feature {
let dpi_factor = dpi_factor as conrod::Scalar;

// Convert glutin event to conrod event, requires conrod to be built with the `glutin` feature
if let Some(event) = conrod::backend::glutin::convert(event.clone(), w, h, dpi_factor) {
if let Some(event) = conrod::backend::glutin::convert(event.clone(), &window) {
ui.handle_event(event);
}

Expand Down
280 changes: 68 additions & 212 deletions examples/glutin_glium.rs

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions examples/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ pub fn theme() -> conrod::Theme {
}


/// Create an image map that maps the `ids.rust_logo` to the `rust_logo` image.
pub fn image_map<T>(ids: &Ids, rust_logo: T) -> conrod::image::Map<T> {
image_map! {
(ids.rust_logo, rust_logo)
}
}


// Generate a unique `WidgetId` for each widget.
widget_ids! {
pub struct Ids {
Expand Down
Loading