Added toggle for ImGui demo window in Debug mode
This commit is contained in:
parent
0d0b2d6962
commit
45bcdc8c46
@ -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
|
||||
|
@ -39,6 +39,7 @@ namespace hex {
|
||||
GLFWwindow* m_window;
|
||||
std::vector<View*> m_views;
|
||||
bool m_fpsVisible = false;
|
||||
bool m_demoWindowOpen = false;
|
||||
|
||||
static inline std::tuple<int, int> s_currShortcut = { -1, -1 };
|
||||
};
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user