From 7cc918fdf8b2a6d24a8f20de46767b4fdd833af2 Mon Sep 17 00:00:00 2001 From: Jasper Date: Fri, 4 Jun 2021 10:51:53 +0200 Subject: [PATCH] [MERGE] merged feature/improve-hand-detection into feature/Start-scene correctly --- src/computervision/ObjectDetection.cpp | 2 +- src/main.cpp | 10 ++++++++-- src/scenes/startup_Scene.cpp | 2 +- src/scenes/startup_Scene.h | 3 +-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/computervision/ObjectDetection.cpp b/src/computervision/ObjectDetection.cpp index 0cf97a5..381b3cf 100644 --- a/src/computervision/ObjectDetection.cpp +++ b/src/computervision/ObjectDetection.cpp @@ -11,7 +11,7 @@ namespace computervision { - cv::VideoCapture cap(0); + cv::VideoCapture cap(1); cv::Mat img, imgGray, img2, img2Gray, img3, img4; diff --git a/src/main.cpp b/src/main.cpp index 7ad70d0..69aa61a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -68,6 +68,10 @@ int main(void) }); bool window_open = true; + + computervision::ObjectDetection objDetect; + cv::Mat cameraFrame; + // Main game loop while (!glfwWindowShouldClose(window) && window_open) { @@ -95,8 +99,10 @@ int main(void) std::cout << "Wrong return value!!! ->" << std::endl; break; } -cameraFrame = objDetect.readCamera(); + + ////////////////////////// KIMS SHIT //////////////////////////////////// + cameraFrame = objDetect.readCamera(); computervision::MenuTest menu_test; //Get hand state from camera @@ -145,7 +151,7 @@ cameraFrame = objDetect.readCamera(); ///////////////////////// END OF KIMS SHIT /////////////////////////////// // Finish up - shader.Stop(); + //shader.Stop(); glfwSwapBuffers(window); glfwPollEvents(); diff --git a/src/scenes/startup_Scene.cpp b/src/scenes/startup_Scene.cpp index 81d88fc..21e891c 100644 --- a/src/scenes/startup_Scene.cpp +++ b/src/scenes/startup_Scene.cpp @@ -8,6 +8,7 @@ #include "../renderEngine/obj_loader.h" #include "../renderEngine/renderer.h" #include "../shaders/entity_shader.h" +#include "../gui/gui_interactable.h" #include "../toolbox/toolbox.h" @@ -74,7 +75,6 @@ namespace scene gui::Button* new_button = ConvertGuiTextureToButton(button); if(new_button != NULL) new_button->Update(window); - } diff --git a/src/scenes/startup_Scene.h b/src/scenes/startup_Scene.h index a2d181c..1b8966e 100644 --- a/src/scenes/startup_Scene.h +++ b/src/scenes/startup_Scene.h @@ -1,6 +1,6 @@ #pragma once #include "scene.h" -#include "../gui/gui_interactable.h" +#include "../gui/gui_element.h" namespace scene { @@ -13,7 +13,6 @@ namespace scene public: Startup_Scene(); - gui::Button* ConvertGuiTextureToButton(gui::GuiTexture* texture); Scenes start(GLFWwindow* window) override; void render() override; void update(GLFWwindow* window) override;