From 38cc784ec866de9b5be61d1368b70a2cc899b180 Mon Sep 17 00:00:00 2001 From: Teo-CD Date: Sat, 12 Oct 2019 15:01:38 +0200 Subject: [PATCH] Added missing display callback Added compiler warnings for MSVC and GNU GCC --- CMakeLists.txt | 8 +++++++- src/main.cpp | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6d55b0..a1ebd9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,4 +34,10 @@ target_link_libraries(tests_opengl target_include_directories(tests_opengl PRIVATE ${OPENGL_INCLUDE_DIR} - ${GLUT_INCLUDE_DIR}) \ No newline at end of file + ${GLUT_INCLUDE_DIR}) + +if (CMAKE_COMPILER_IS_GNUCXX) + target_compile_options(tests_opengl PRIVATE -Wall -Wpedantic -Wextra) +elseif(MSVC) + target_compile_options(tests_opengl PRIVATE /W4) +endif() \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 0ce588c..8efa7a8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -118,6 +118,7 @@ int main(int argc, char** argv) glViewport(0,0,glutGet(GLUT_WINDOW_WIDTH),glutGet(GLUT_WINDOW_HEIGHT)); + glutDisplayFunc(display); glutIdleFunc(display); glutTimerFunc(50,update_angle,0); KeyStateManager::register_glut_callbacks();