diff --git a/src/debug.rs b/src/debug.rs index 38afaf0..c46dcd9 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -101,20 +101,24 @@ impl Debug { fn displayTest(ui: &mut imgui::Ui, testI: &mut info::testI) -> Vec { let mut ret = Vec::new(); + let mut selectedModel = testI.selectedModel; + let mut spinSpeed = testI.spinSpeed; ui.window("POLY I WILL FUCKING") .size([500.0, 100.0], imgui::Condition::FirstUseEver) .build(|| { ui.text("you serve no purpose in life"); ui.text("Your Purpose in life is to suck my dick"); - ui.slider("The Spin Speed", 0.1, 10.0, &mut testI.spinSpeed); + ui.slider("The Spin Speed", 0.1, 10.0, &mut spinSpeed); if ui .button("Quit") { ret.push(dEvent::exit); } - if ui.list_box("Select Model to Load", &mut testI.selectedModel, &MODELS, 5) { - ret.push(dEvent::loadModel(testI.selectedModel)); + if ui.list_box("Select Model to Load", &mut selectedModel, &MODELS, 5) { + ret.push(dEvent::loadModel(selectedModel)); } }); + ret.push(dEvent::setTest(spinSpeed, selectedModel + )); ret } diff --git a/src/scene.rs b/src/scene.rs index 2629b03..6e72dd2 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: true, + DebugMode: false, selectedModel: 0, }; @@ -136,10 +136,12 @@ impl Scene{ match command { dEvent::exit => ret = SceneEnum::Exit, - dEvent::loadModel(i) => { - self.Car = Model::new(MODELS[i as usize], Arc::clone(&self.gl)); + dEvent::loadModel(i) => self.Car = Model::new(MODELS[i as usize], Arc::clone(&self.gl)), + dEvent::setTest(a, b) => { + self.tempData.spinSpeed = a; + self.tempData.selectedModel = b; } - _ => (), + } } }