mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-12 05:58:35 +00:00
Merge pull request #145 from malikolivier/refactor-hello-gfx
Refactor hello gfx: - Remove unused label on main loop - Do not depend on imgui_sys
This commit is contained in:
commit
1663e66887
@ -16,4 +16,3 @@ glutin = "0.17"
|
||||
imgui = { version = "0.0.19-pre", path = "../" }
|
||||
imgui-gfx-renderer = { version = "0.0.19-pre", path = "../imgui-gfx-renderer" }
|
||||
imgui-glium-renderer = { version = "0.0.19-pre", path = "../imgui-glium-renderer" }
|
||||
imgui-sys = { version = "0.0.19-pre", path = "../imgui-sys", features = ["gfx", "glium"] }
|
||||
|
||||
@ -4,7 +4,6 @@ extern crate glutin;
|
||||
#[macro_use]
|
||||
extern crate imgui;
|
||||
extern crate imgui_gfx_renderer;
|
||||
extern crate imgui_sys;
|
||||
|
||||
use imgui::*;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
use imgui::{FontGlyphRange, ImFontConfig, ImGui, ImGuiMouseCursor, Ui};
|
||||
use imgui::{FontGlyphRange, ImFontConfig, ImGui, ImGuiMouseCursor, ImVec4, Ui};
|
||||
use imgui_gfx_renderer::{Renderer, Shaders};
|
||||
use std::time::Instant;
|
||||
|
||||
@ -45,8 +45,6 @@ pub fn run<F: FnMut(&Ui) -> bool>(title: String, clear_color: [f32; 4], mut run_
|
||||
let mut imgui = ImGui::init();
|
||||
{
|
||||
// Fix incorrect colors with sRGB framebuffer
|
||||
use imgui_sys::ImVec4;
|
||||
|
||||
fn imgui_gamma_to_linear(col: ImVec4) -> ImVec4 {
|
||||
let x = col.x.powf(2.2);
|
||||
let y = col.y.powf(2.2);
|
||||
@ -74,7 +72,7 @@ pub fn run<F: FnMut(&Ui) -> bool>(title: String, clear_color: [f32; 4], mut run_
|
||||
let mut mouse_state = MouseState::default();
|
||||
let mut quit = false;
|
||||
|
||||
'running: loop {
|
||||
loop {
|
||||
events_loop.poll_events(|event| {
|
||||
use glutin::WindowEvent::*;
|
||||
use glutin::ElementState::Pressed;
|
||||
@ -145,7 +143,7 @@ pub fn run<F: FnMut(&Ui) -> bool>(title: String, clear_color: [f32; 4], mut run_
|
||||
}
|
||||
});
|
||||
if quit {
|
||||
break 'running;
|
||||
break;
|
||||
}
|
||||
|
||||
let now = Instant::now();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user