From 85f18abeeeff56356be5c94bb77630c205f988b4 Mon Sep 17 00:00:00 2001 From: Joonas Javanainen Date: Sun, 5 Nov 2017 23:17:53 +0200 Subject: [PATCH] Revert "Move hello_gfx example under the gfx renderer crate" This reverts commit 9b257b9ab60f7f844df6ad219d6d54bfa1047e6e. --- imgui-examples/Cargo.toml | 5 ++++- {imgui-gfx-renderer => imgui-examples}/examples/hello_gfx.rs | 4 ++-- .../support => imgui-examples/examples/support_gfx}/mod.rs | 1 - imgui-gfx-renderer/Cargo.toml | 4 ---- imgui-gfx-renderer/src/lib.rs | 5 +---- 5 files changed, 7 insertions(+), 12 deletions(-) rename {imgui-gfx-renderer => imgui-examples}/examples/hello_gfx.rs (87%) rename {imgui-gfx-renderer/examples/support => imgui-examples/examples/support_gfx}/mod.rs (99%) diff --git a/imgui-examples/Cargo.toml b/imgui-examples/Cargo.toml index 05d4e27..8abc744 100644 --- a/imgui-examples/Cargo.toml +++ b/imgui-examples/Cargo.toml @@ -9,8 +9,11 @@ license = "MIT/Apache-2.0" publish = false [dev-dependencies] +gfx = "0.16" +gfx_window_glutin = "0.18" glium = { version = "0.18", default-features = true } glutin = "0.10" imgui = { version = "0.0.17-pre", path = "../" } +imgui-gfx-renderer = { version = "0.0.17-pre", path = "../imgui-gfx-renderer" } imgui-glium-renderer = { version = "0.0.17-pre", path = "../imgui-glium-renderer" } -imgui-sys = { version = "0.0.17-pre", path = "../imgui-sys", features = ["glium"] } +imgui-sys = { version = "0.0.17-pre", path = "../imgui-sys", features = ["gfx", "glium"] } diff --git a/imgui-gfx-renderer/examples/hello_gfx.rs b/imgui-examples/examples/hello_gfx.rs similarity index 87% rename from imgui-gfx-renderer/examples/hello_gfx.rs rename to imgui-examples/examples/hello_gfx.rs index b0a1e67..5bcdc48 100644 --- a/imgui-gfx-renderer/examples/hello_gfx.rs +++ b/imgui-examples/examples/hello_gfx.rs @@ -7,11 +7,11 @@ extern crate imgui_gfx_renderer; use imgui::*; -mod support; +mod support_gfx; const CLEAR_COLOR: [f32; 4] = [1.0, 1.0, 1.0, 1.0]; -fn main() { support::run("hello_gfx.rs".to_owned(), CLEAR_COLOR, hello_world); } +fn main() { support_gfx::run("hello_gfx.rs".to_owned(), CLEAR_COLOR, hello_world); } fn hello_world<'a>(ui: &Ui<'a>) -> bool { ui.window(im_str!("Hello world")) diff --git a/imgui-gfx-renderer/examples/support/mod.rs b/imgui-examples/examples/support_gfx/mod.rs similarity index 99% rename from imgui-gfx-renderer/examples/support/mod.rs rename to imgui-examples/examples/support_gfx/mod.rs index 585e44c..9e4226b 100644 --- a/imgui-gfx-renderer/examples/support/mod.rs +++ b/imgui-examples/examples/support_gfx/mod.rs @@ -46,7 +46,6 @@ pub fn run bool>(title: String, clear_color: [f32; 4], mut run_ }; let mut imgui = ImGui::init(); - imgui.set_ini_filename(None); let mut renderer = Renderer::init(&mut imgui, &mut factory, shaders, main_color.clone()) .expect("Failed to initialize renderer"); diff --git a/imgui-gfx-renderer/Cargo.toml b/imgui-gfx-renderer/Cargo.toml index d99e472..62a99c0 100644 --- a/imgui-gfx-renderer/Cargo.toml +++ b/imgui-gfx-renderer/Cargo.toml @@ -13,9 +13,5 @@ travis-ci = { repository = "Gekkio/imgui-rs" } [dependencies] gfx = "0.16" -glutin = "0.10" imgui = { version = "0.0.17-pre", path = "../" } imgui-sys = { version = "0.0.17-pre", path = "../imgui-sys", features = ["gfx"] } - -[dev-dependencies] -gfx_window_glutin = "0.18" diff --git a/imgui-gfx-renderer/src/lib.rs b/imgui-gfx-renderer/src/lib.rs index 8828261..f3c5dfe 100644 --- a/imgui-gfx-renderer/src/lib.rs +++ b/imgui-gfx-renderer/src/lib.rs @@ -38,10 +38,7 @@ gfx_defines!{ vertex_buffer: gfx::VertexBuffer = (), matrix: gfx::Global<[[f32; 4]; 4]> = "matrix", tex: gfx::TextureSampler<[f32; 4]> = "tex", - out: gfx::BlendTarget = ( - "Target0", gfx::state::MASK_ALL, - gfx::preset::blend::ALPHA - ), + out: gfx::BlendTarget = ("Target0", gfx::state::MASK_ALL, gfx::preset::blend::ALPHA), scissor: gfx::Scissor = (), } }