i learned my lesson, i will be less lazy from now on
parent
e5101f6c7d
commit
ecdcf00b0f
|
@ -25,8 +25,8 @@ pub enum Callback
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub enum OpenWindows {
|
pub enum OpenWindows {
|
||||||
|
ModelInfo,
|
||||||
TestWind,
|
TestWind,
|
||||||
ModelInfo
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Debug {
|
pub struct Debug {
|
||||||
|
@ -81,7 +81,9 @@ impl Debug {
|
||||||
{
|
{
|
||||||
match call {
|
match call {
|
||||||
Callback::ModelInfo(a) =>
|
Callback::ModelInfo(a) =>
|
||||||
Debug::displayModel(ui, &a),
|
{
|
||||||
|
Debug::displayModel(ui, &a)
|
||||||
|
},
|
||||||
Callback::TestWind(mut a) =>
|
Callback::TestWind(mut a) =>
|
||||||
ret = Debug::displayTest(ui, &mut a),
|
ret = Debug::displayTest(ui, &mut a),
|
||||||
}
|
}
|
||||||
|
|
13
src/scene.rs
13
src/scene.rs
|
@ -74,7 +74,7 @@ impl Scene{
|
||||||
currentFrame: 0.0,
|
currentFrame: 0.0,
|
||||||
deltaTime: 0.0,
|
deltaTime: 0.0,
|
||||||
lastFrame: 0.0,
|
lastFrame: 0.0,
|
||||||
DebugMode: false,
|
DebugMode: true,
|
||||||
selectedModel: 0,
|
selectedModel: 0,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -117,20 +117,19 @@ impl Scene{
|
||||||
}
|
}
|
||||||
self.Car.Draw(&self.shaders[0]);
|
self.Car.Draw(&self.shaders[0]);
|
||||||
|
|
||||||
|
|
||||||
if self.tempData.DebugMode{
|
if self.tempData.DebugMode{
|
||||||
let mut Callbacks = Vec::new();
|
let mut Callbacks = Vec::new();
|
||||||
let windows = self.debug.windows.clone();
|
let windows = self.debug.windows.clone();
|
||||||
for i in 0..windows.len()
|
for window in windows
|
||||||
{
|
{
|
||||||
|
match window {
|
||||||
match &windows[i] {
|
debug::OpenWindows::ModelInfo => Callbacks.push(debug::ModelInfo(&self.Car)),
|
||||||
ModelInfo => Callbacks.push(debug::ModelInfo(&self.Car)),
|
debug::OpenWindows::TestWind => Callbacks.push(debug::TestWind(self.tempData.spinSpeed, self.tempData.selectedModel)),
|
||||||
TestWind => Callbacks.push(debug::TestWind(self.tempData.spinSpeed, self.tempData.selectedModel)),
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for command in self.debug.drawImgui(&events_loop, &window, Callbacks)
|
for command in self.debug.drawImgui(&events_loop, &window, Callbacks)
|
||||||
{
|
{
|
||||||
use crate::debug::dEvent;
|
use crate::debug::dEvent;
|
||||||
|
|
Loading…
Reference in New Issue