Remove imgui from the entire project
This commit is contained in:
parent
306774c15b
commit
13aefcc86f
12 changed files with 16 additions and 125 deletions
|
|
@ -8,5 +8,4 @@ hecs = "0.10.5"
|
|||
indexmap = "2.10.0"
|
||||
raidillon_assets = { path = "../asset" }
|
||||
winit = "0.30.12"
|
||||
imgui = "0.12.0"
|
||||
egui = "0.33.2"
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
pub enum UICommand {
|
||||
Text(String),
|
||||
Separator,
|
||||
SliderF32 { label: String, min: f32, max: f32, value: std::rc::Rc<std::cell::RefCell<f32>> },
|
||||
}
|
||||
|
||||
pub struct DebugUIBuffer {
|
||||
cmds: Vec<UICommand>,
|
||||
}
|
||||
|
||||
impl DebugUIBuffer {
|
||||
pub fn new() -> DebugUIBuffer {
|
||||
DebugUIBuffer { cmds: vec![] }
|
||||
}
|
||||
|
||||
// Commands
|
||||
pub fn text(&mut self, text: String) {
|
||||
self.cmds.push(UICommand::Text(text));
|
||||
}
|
||||
|
||||
pub fn separator(&mut self) {
|
||||
self.cmds.push(UICommand::Separator);
|
||||
}
|
||||
|
||||
pub fn slider_f32<T: Into<String>>(&mut self, label: T, min: f32, max: f32, value: std::rc::Rc<std::cell::RefCell<f32>>) {
|
||||
self.cmds.push(UICommand::SliderF32 { label: label.into(), min, max, value });
|
||||
}
|
||||
// End of commands
|
||||
|
||||
pub fn write_buffer(&self, ui: &imgui::Ui) {
|
||||
for cmd in &self.cmds {
|
||||
match cmd {
|
||||
UICommand::Text(s) => {
|
||||
ui.text(s);
|
||||
}
|
||||
UICommand::Separator => {
|
||||
ui.separator();
|
||||
}
|
||||
UICommand::SliderF32 { label, min, max, value } => {
|
||||
let mut v = value.borrow_mut();
|
||||
ui.slider_config(label.as_str(), *min, *max).build(&mut *v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn reset_buffer(&mut self) {
|
||||
self.cmds = vec![];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
use crate::DebugUIBuffer;
|
||||
use crate::scene::Scene;
|
||||
|
||||
pub trait EngineTrait {
|
||||
|
|
@ -10,6 +9,4 @@ pub trait EngineTrait {
|
|||
fn handle_event(&mut self, platform_context: Self::PlatformCtx);
|
||||
fn current_scene_mut(&mut self) -> &mut Scene;
|
||||
fn current_scene(&self) -> &Scene;
|
||||
fn get_debug_ui_buffer(&self) -> &DebugUIBuffer;
|
||||
fn reset_debug_ui_buffer(&mut self);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
pub mod engine;
|
||||
pub mod debug_ui;
|
||||
pub mod time;
|
||||
pub mod utils;
|
||||
pub mod scene;
|
||||
mod egui_queue;
|
||||
|
||||
pub use debug_ui::*;
|
||||
pub use egui_queue::EguiQueue;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::collections::HashMap;
|
||||
use std::path::{Path, PathBuf};
|
||||
use crate::{define_typemap, DebugUIBuffer};
|
||||
use crate::{define_typemap};
|
||||
|
||||
pub struct Scene {
|
||||
pub title: String,
|
||||
|
|
@ -23,10 +23,7 @@ impl Scene {
|
|||
s
|
||||
}
|
||||
|
||||
pub fn load_default_resources(&mut self) {
|
||||
let dbg = DebugUIBuffer::new();
|
||||
self.resources.insert(dbg);
|
||||
}
|
||||
pub fn load_default_resources(&mut self) {}
|
||||
}
|
||||
|
||||
impl Scene {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue