[ADD] start of number display
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
#include <opencv2/core/base.hpp>
|
#include <opencv2/core/base.hpp>
|
||||||
#include "../computervision/HandDetectRegion.h"
|
#include "../computervision/HandDetectRegion.h"
|
||||||
#include "../computervision/ObjectDetection.h"
|
#include "../computervision/ObjectDetection.h"
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#define MAX_MODEL_DEQUE_SIZE 6 // max amount of models to load at the same time
|
#define MAX_MODEL_DEQUE_SIZE 6 // max amount of models to load at the same time
|
||||||
#define UPCOMING_MODEL_AMOUNT 4 // how much models should be loaded in front of us
|
#define UPCOMING_MODEL_AMOUNT 4 // how much models should be loaded in front of us
|
||||||
@@ -264,6 +265,7 @@ namespace scene
|
|||||||
score += furniture_count_old;
|
score += furniture_count_old;
|
||||||
std::cout << "Score: " << score << std::endl;
|
std::cout << "Score: " << score << std::endl;
|
||||||
std::cout << "Funriture_count_old in model (house excluded): " << furniture_count_old << std::endl;
|
std::cout << "Funriture_count_old in model (house excluded): " << furniture_count_old << std::endl;
|
||||||
|
DrawScore();
|
||||||
}
|
}
|
||||||
// remember the position at which the new model was added
|
// remember the position at which the new model was added
|
||||||
last_model_pos = model_pos;
|
last_model_pos = model_pos;
|
||||||
@@ -320,4 +322,12 @@ namespace scene
|
|||||||
{
|
{
|
||||||
render_engine::renderer::Render(pause_guis, *gui_shader);
|
render_engine::renderer::Render(pause_guis, *gui_shader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void In_Game_Scene::DrawScore(cv::Mat& output_frame)
|
||||||
|
{
|
||||||
|
cv::rectangle(output_frame, cv::Rect(0, 0, 30, 40), cv::Scalar(0, 0, 0), -1);
|
||||||
|
cv::putText(output_frame, "Score: ", cv::Point(0, 0), cv::FONT_HERSHEY_PLAIN, 2.0, cv::Scalar(18, 219, 65), 2);
|
||||||
|
cv::putText(output_frame, std::to_string(score), cv::Point(5, 15), cv::FONT_HERSHEY_PLAIN, 2.0, cv::Scalar(18, 219, 65), 2);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
#include "../renderEngine/renderer.h"
|
#include "../renderEngine/renderer.h"
|
||||||
#include "../shaders/entity_shader.h"
|
#include "../shaders/entity_shader.h"
|
||||||
#include "../toolbox/toolbox.h"
|
#include "../toolbox/toolbox.h"
|
||||||
|
#include <opencv2/core/base.hpp>
|
||||||
|
#include <opencv2/imgcodecs.hpp>
|
||||||
|
#include <opencv2/imgproc.hpp>
|
||||||
|
|
||||||
|
|
||||||
namespace scene
|
namespace scene
|
||||||
@@ -97,6 +100,8 @@ namespace scene
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
void onKey(GLFWwindow* window, int key, int scancode, int action, int mods) override;
|
void onKey(GLFWwindow* window, int key, int scancode, int action, int mods) override;
|
||||||
|
|
||||||
|
void DrawScore(cv::Mat& output_frame);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user