diff --git a/src/debug.rs b/src/debug.rs index 0b45bdd..38afaf0 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -25,8 +25,8 @@ pub enum Callback #[derive(Clone)] pub enum OpenWindows { + ModelInfo, TestWind, - ModelInfo } pub struct Debug { @@ -81,7 +81,9 @@ impl Debug { { match call { Callback::ModelInfo(a) => - Debug::displayModel(ui, &a), + { + Debug::displayModel(ui, &a) + }, Callback::TestWind(mut a) => ret = Debug::displayTest(ui, &mut a), } diff --git a/src/scene.rs b/src/scene.rs index d1bc121..2629b03 100644 --- a/src/scene.rs +++ b/src/scene.rs @@ -74,7 +74,7 @@ impl Scene{ currentFrame: 0.0, deltaTime: 0.0, lastFrame: 0.0, - DebugMode: false, + DebugMode: true, selectedModel: 0, }; @@ -117,20 +117,19 @@ impl Scene{ } self.Car.Draw(&self.shaders[0]); - if self.tempData.DebugMode{ let mut Callbacks = Vec::new(); let windows = self.debug.windows.clone(); - for i in 0..windows.len() + for window in windows { - - match &windows[i] { - ModelInfo => Callbacks.push(debug::ModelInfo(&self.Car)), - TestWind => Callbacks.push(debug::TestWind(self.tempData.spinSpeed, self.tempData.selectedModel)), + match window { + debug::OpenWindows::ModelInfo => Callbacks.push(debug::ModelInfo(&self.Car)), + debug::OpenWindows::TestWind => Callbacks.push(debug::TestWind(self.tempData.spinSpeed, self.tempData.selectedModel)), } } + for command in self.debug.drawImgui(&events_loop, &window, Callbacks) { use crate::debug::dEvent;