diff --git a/CMakeLists.txt b/CMakeLists.txt index ca15656..d0ed68b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,14 +29,15 @@ set(SOURCE_FILES src/CollisionEngine.cpp include/CollisionEngine.h - src/DebugRendering.cpp - include/DebugRendering.h - include/DebugRendering/DebugBox.h src/DebugRendering/DebugBox.cpp include/DebugRendering/DebugEntry.h src/DebugRendering/DebugEntry.cpp + src/DebugRendering/DebugLine.cpp + include/DebugRendering/DebugLine.h + Scenes/star_viewer.cpp + Scenes/star_viewer.h ) diff --git a/include/DebugRendering.h b/include/DebugRendering/DebugLine.h similarity index 71% rename from include/DebugRendering.h rename to include/DebugRendering/DebugLine.h index 63a4f3e..bf57c89 100644 --- a/include/DebugRendering.h +++ b/include/DebugRendering/DebugLine.h @@ -1,9 +1,9 @@ // -// Created by Conni Bilham on 15/07/2023. +// Created by Conni Bilham on 16/10/2023. // -#ifndef INC_2D_ENGINE_DEBUGRENDERING_H -#define INC_2D_ENGINE_DEBUGRENDERING_H +#ifndef INC_2D_ENGINE_DEBUGLINE_H +#define INC_2D_ENGINE_DEBUGLINE_H #include #include "vec3.hpp" @@ -26,4 +26,4 @@ class DebugLine : public DebugEntry { }; -#endif //INC_2D_ENGINE_DEBUGRENDERING_H +#endif //INC_2D_ENGINE_DEBUGLINE_H diff --git a/include/Storage.h b/include/Storage.h index 46b95c4..cc5ab89 100644 --- a/include/Storage.h +++ b/include/Storage.h @@ -15,7 +15,7 @@ class Storage { public: unsigned int major = 0; unsigned int minor = 2; - unsigned int patch = 1; + unsigned int patch = 2; unsigned int build = 1; } version; diff --git a/main.cpp b/main.cpp index 57235f0..91af13b 100644 --- a/main.cpp +++ b/main.cpp @@ -14,7 +14,7 @@ Storage* storage; -#define T_STR(v) std::to_string(storage->get()->version.v) +#define T_STR(v) std::to_string(storage->version.v) #define BUILD_STRING T_STR(major) + "." + T_STR(minor) + "." + T_STR(patch) + " Build " + T_STR(build) int main() { storage = new Storage(); diff --git a/src/DebugRendering/DebugBox.cpp b/src/DebugRendering/DebugBox.cpp index e4e21ae..1e0df9b 100644 --- a/src/DebugRendering/DebugBox.cpp +++ b/src/DebugRendering/DebugBox.cpp @@ -2,10 +2,12 @@ // Created by Conni Bilham on 28/08/2023. // -#include "DebugRendering.h" +#include #include "DebugRendering/DebugBox.h" #include "glad/glad.h" +#include "../include/logging.h" + DebugBox::DebugBox(unsigned int shader_id, glm::vec3 start, glm::vec3 end) { this->shader_id = shader_id; this->start = start; @@ -13,11 +15,11 @@ DebugBox::DebugBox(unsigned int shader_id, glm::vec3 start, glm::vec3 end) { } DebugBox::~DebugBox() { - std::cout << "Box::~Box()" << std::endl; + logging::verbose("Box::~Box()"); } void DebugBox::load() { - std::cout << "Box::load()" << std::endl; + logging::verbose("Box::load()"); float vertices[] = { start.x, start.y, 0.0f, end.x, start.y, 0.0f, @@ -66,5 +68,5 @@ void DebugBox::draw() { } void DebugBox::init() { - std::cout << "Box::init()" << std::endl; + logging::verbose("Box::init()"); } diff --git a/src/DebugRendering.cpp b/src/DebugRendering/DebugLine.cpp similarity index 97% rename from src/DebugRendering.cpp rename to src/DebugRendering/DebugLine.cpp index 9358cc4..fc7f14f 100644 --- a/src/DebugRendering.cpp +++ b/src/DebugRendering/DebugLine.cpp @@ -2,7 +2,7 @@ // Created by Conni Bilham on 15/07/2023. // -#include "DebugRendering.h" +#include "DebugRendering/DebugLine.h" #include "glad/glad.h" DebugLine::DebugLine(unsigned int shader_id, glm::vec3 start, glm::vec3 end) { diff --git a/src/logging.cpp b/src/logging.cpp index d58f447..6a8bd23 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -3,14 +3,14 @@ // #define RESET "\033[0m" -#define BLACK "\033[30m" /* Black */ -#define RED "\033[31m" /* Red */ -#define GREEN "\033[32m" /* Green */ -#define YELLOW "\033[33m" /* Yellow */ -#define BLUE "\033[34m" /* Blue */ -#define MAGENTA "\033[35m" /* Magenta */ -#define CYAN "\033[36m" /* Cyan */ -#define WHITE "\033[37m" /* White */ +#define BLACK "\033[30m" /* Black */ +#define RED "\033[31m" /* Red */ +#define GREEN "\033[32m" /* Green */ +#define YELLOW "\033[33m" /* Yellow */ +#define BLUE "\033[34m" /* Blue */ +#define MAGENTA "\033[35m" /* Magenta */ +#define CYAN "\033[36m" /* Cyan */ +#define WHITE "\033[37m" /* White */ #define BOLDBLACK "\033[1m\033[30m" /* Bold Black */ #define BOLDRED "\033[1m\033[31m" /* Bold Red */ #define BOLDGREEN "\033[1m\033[32m" /* Bold Green */ @@ -23,8 +23,6 @@ #include #include "../include/logging.h" -// TODO: Add colour - void logging::log(const std::string& message) { auto c_time = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); std::cout << BOLDWHITE << "[" << std::put_time(std::localtime(&c_time), "%F %T") << "] " << RESET << message << std::endl; diff --git a/src/window.cpp b/src/window.cpp index 0fbfed1..f3452ba 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -32,10 +32,10 @@ Window::Window(int width, int height, std::string title, int fullscreen, Camera* return; } - logging::debug("OpenGL Version: " + std::string((char*)glGetString(GL_VERSION))); - logging::debug("OpenGL Vendor: " + std::string((char*)glGetString(GL_VENDOR))); + logging::debug("OpenGL Version: " + std::string((char*)glGetString(GL_VERSION))); + logging::debug("OpenGL Vendor: " + std::string((char*)glGetString(GL_VENDOR))); logging::debug("OpenGL Renderer: " + std::string((char*)glGetString(GL_RENDERER))); - logging::debug("OpenGL Shading Language Version: " + std::string((char*)glGetString(GL_SHADING_LANGUAGE_VERSION))); + logging::debug("GL Shading VRS: " + std::string((char*)glGetString(GL_SHADING_LANGUAGE_VERSION))); glfwSetKeyCallback(window, key_callback); glfwSetCharCallback(window, character_callback);