From 99123d7b8d0491d2252c9188ad073cef498423a5 Mon Sep 17 00:00:00 2001 From: Benedikt Mandelkow Date: Tue, 13 Oct 2020 11:24:20 +0200 Subject: [PATCH] update imgui-wgpu --- implot-wgpu-examples/Cargo.toml | 3 +-- implot-wgpu-examples/src/main.rs | 11 ++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/implot-wgpu-examples/Cargo.toml b/implot-wgpu-examples/Cargo.toml index f417e33..f4c504b 100644 --- a/implot-wgpu-examples/Cargo.toml +++ b/implot-wgpu-examples/Cargo.toml @@ -8,9 +8,8 @@ edition = "2018" implot = { path = "../" } wgpu = "^0.6.0" -wgpu-subscriber = "^0.1.0" # tracing, also chrome profiling format support winit = "^0.22.2" # opening windows and handling input futures = "^0.3.5" # executing async functions using blocking executor imgui = "^0.5.0" imgui-winit-support = "^0.5.0" # connection of input (keys) to imgui -imgui-wgpu = "^0.10.0" # imgui backend for drawing using wgpu +imgui-wgpu = "^0.11.0" # imgui backend for drawing using wgpu diff --git a/implot-wgpu-examples/src/main.rs b/implot-wgpu-examples/src/main.rs index f95979c..0d73f8b 100644 --- a/implot-wgpu-examples/src/main.rs +++ b/implot-wgpu-examples/src/main.rs @@ -1,5 +1,5 @@ use imgui::{im_str, CollapsingHeader, Condition, FontSource}; -use imgui_wgpu::Renderer; +use imgui_wgpu::RendererConfig; use std::time::Instant; use winit::{ event::{Event, WindowEvent}, @@ -81,7 +81,9 @@ async fn run(event_loop: EventLoop<()>, window: Window, swapchain_format: wgpu:: let style = imgui.style_mut(); style.use_classic_colors(); - let mut renderer = Renderer::new(&mut imgui, &device, &queue, sc_desc.format); + let mut renderer = RendererConfig::new() + .set_texture_format(sc_desc.format) + .build(&mut imgui, &device, &queue); let mut last_frame = Instant::now(); let mut last_cursor = None; @@ -137,8 +139,8 @@ async fn run(event_loop: EventLoop<()>, window: Window, swapchain_format: wgpu:: let border = 10.0; window.position([0.0, 0.0], Condition::Always).size( [ - sc_desc.width as f32 / hidpi_factor - border, - sc_desc.height as f32 / hidpi_factor - border, + sc_desc.width as f32 / hidpi_factor as f32 - border, + sc_desc.height as f32 / hidpi_factor as f32 - border, ], Condition::Always, ) @@ -228,7 +230,6 @@ async fn run(event_loop: EventLoop<()>, window: Window, swapchain_format: wgpu:: fn main() { let event_loop = EventLoop::new(); let window = winit::window::Window::new(&event_loop).unwrap(); - wgpu_subscriber::initialize_default_subscriber(None); // Temporarily avoid srgb formats for the swapchain on the web futures::executor::block_on(run(event_loop, window, wgpu::TextureFormat::Bgra8UnormSrgb)); }