From 33e7baed94f198288709af85a316bc51f13bafc7 Mon Sep 17 00:00:00 2001 From: Faerbit Date: Sun, 15 Mar 2015 15:18:16 +0100 Subject: [PATCH] Reenabling debug features for debug builds. --- CMakeLists.txt | 3 +++ game/main.cc | 8 ++++---- game/model.cc | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a120b2..8273bea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,9 @@ ADD_DEFINITIONS(-DNO_SPACE_NAVIGATOR_SUPPORT) # # Lets the binary get written to a shared folder (which can be ignored by git). # Will also set the run directory for QTCreator: +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -DSAXUM_DEBUG") +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -DSAXUM_DEBUG") + set(dir ${CMAKE_CURRENT_SOURCE_DIR}/binaries) set(EXECUTABLE_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE) diff --git a/game/main.cc b/game/main.cc index 7cebbb5..aa40c58 100644 --- a/game/main.cc +++ b/game/main.cc @@ -23,7 +23,7 @@ static void keyCallback(GLFWwindow* _window, int _key, int, int _action, int) glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); app.setCameraLock(false); } -#ifdef CMAKE_CXX_FLAGS_DEBUG +#ifdef SAXUM_DEBUG if (_key == GLFW_KEY_F5 && _action == GLFW_PRESS) { app.getGraphics()->setRenderShadows(!app.getGraphics()->getRenderShadows()); } @@ -104,7 +104,7 @@ bool createWindow() // activate multisampling (second parameter is the number of samples): glfwWindowHint( GLFW_SAMPLES, 4); - #ifdef CMAKE_CXX_FLAGS_DEBUG + #ifdef SAXUM_DEBUG // request an OpenGL debug context: glfwWindowHint( GLFW_OPENGL_DEBUG_CONTEXT, true ); #endif @@ -120,7 +120,7 @@ bool createWindow() return false; } glfwMakeContextCurrent(window); - #ifdef CMAKE_CXX_FLAGS_DEBUG + #ifdef SAXUM_DEBUG ACGL::init(true); #else ACGL::init(false); // do not request debug context @@ -188,7 +188,7 @@ int main( int argc, char *argv[] ) keyboardState.aPressed = glfwGetKey(window, GLFW_KEY_A) == GLFW_PRESS; keyboardState.sPressed = glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS; keyboardState.dPressed = glfwGetKey(window, GLFW_KEY_D) == GLFW_PRESS; - #ifdef CMAKE_CXX_FLAGS_DEBUG + #ifdef SAXUM_DEBUG keyboardState.lPressed = glfwGetKey(window, GLFW_KEY_L) == GLFW_PRESS; keyboardState.kPressed = glfwGetKey(window, GLFW_KEY_K) == GLFW_PRESS; keyboardState.f1Pressed = glfwGetKey(window, GLFW_KEY_F1) == GLFW_PRESS; diff --git a/game/model.cc b/game/model.cc index 0810b0f..00178ba 100644 --- a/game/model.cc +++ b/game/model.cc @@ -1,7 +1,7 @@ #include "model.hh" Model::Model(std::string filePath, float scale) { - #ifdef CMAKE_CXX_FLAGS_DEBUG + #ifdef SAXUM_DEBUG printf("Loading %s\n", filePath.c_str()); #endif reference = ACGL::OpenGL::VertexArrayObjectCreator(filePath).create();