Reenabling debug features for debug builds.

This commit is contained in:
Faerbit 2015-03-15 15:18:16 +01:00
parent 5d52c9cdaf
commit 33e7baed94
3 changed files with 8 additions and 5 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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();