diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c0f2c463..7d72ace30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,9 @@ if (WIN32) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc -static") endif (WIN32) +SET(CMAKE_CXX_FLAGS_RELEASE -DRELEASE) +SET(CMAKE_CXX_FLAGS_DEBUG -DDEBUG) + add_executable(ImHex source/main.cpp source/window.cpp diff --git a/include/window.hpp b/include/window.hpp index 1e9d0f22c..188fda918 100644 --- a/include/window.hpp +++ b/include/window.hpp @@ -39,6 +39,7 @@ namespace hex { GLFWwindow* m_window; std::vector m_views; bool m_fpsVisible = false; + bool m_demoWindowOpen = false; static inline std::tuple s_currShortcut = { -1, -1 }; }; diff --git a/source/window.cpp b/source/window.cpp index 0ce83af51..fafac882b 100644 --- a/source/window.cpp +++ b/source/window.cpp @@ -75,6 +75,11 @@ namespace hex { view->createView(); } + #ifdef DEBUG + if (this->m_demoWindowOpen) + ImGui::ShowDemoWindow(&this->m_demoWindowOpen); + #endif + this->frameEnd(); } } @@ -107,7 +112,11 @@ namespace hex { view->createMenu(); if (ImGui::BeginMenu("View")) { + ImGui::Separator(); ImGui::MenuItem("Display FPS", "", &this->m_fpsVisible); + #ifdef DEBUG + ImGui::MenuItem("Demo View", "", &this->m_demoWindowOpen); + #endif ImGui::EndMenu(); } @@ -161,9 +170,9 @@ namespace hex { if (!glfwInit()) throw std::runtime_error("Failed to initialize GLFW!"); -#ifdef __APPLE__ - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); -#endif + #ifdef __APPLE__ + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); + #endif glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);