Просмотр исходного кода

changes to build and run on arch

Thomas Buck 7 месяцев назад
Родитель
Сommit
4c45678d59
5 измененных файлов: 13 добавлений и 10 удалений
  1. 1
    0
      .gitignore
  2. 1
    1
      CMakeLists.txt
  3. 1
    1
      include/Log.h
  4. 1
    0
      src/CMakeLists.txt
  5. 9
    8
      src/main.cpp

+ 1
- 0
.gitignore Просмотреть файл

@@ -5,3 +5,4 @@ Icon
5 5
 
6 6
 build*
7 7
 .idea
8
+.directory

+ 1
- 1
CMakeLists.txt Просмотреть файл

@@ -52,7 +52,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
52 52
 endif()
53 53
 
54 54
 # Flags for all builds
55
-set (OpenRaider_CXX_FLAGS "${OpenRaider_CXX_FLAGS} ${WARNINGS}")
55
+set (OpenRaider_CXX_FLAGS "${OpenRaider_CXX_FLAGS} ${WARNINGS} -DGLM_ENABLE_EXPERIMENTAL")
56 56
 
57 57
 # Flags for Debug build
58 58
 set (OpenRaider_CXX_FLAGS_DEBUG "${OpenRaider_CXX_FLAGS_DEBUG} -DDEBUG")

+ 1
- 1
include/Log.h Просмотреть файл

@@ -65,7 +65,7 @@ class LogLevel {
65 65
     template<typename T>
66 66
     LogLevel& operator<< (const T t) {
67 67
         printBuffer << t;
68
-        if (printBuffer.str().back() == Log::endl) {
68
+        if ((printBuffer.str().length() > 0) && (printBuffer.str().back() == Log::endl)) {
69 69
             std::string s = printBuffer.str().substr(0, printBuffer.str().length() - 1);
70 70
             printBuffer.str("");
71 71
             Log::wholeLog.emplace_back(s, level);

+ 1
- 0
src/CMakeLists.txt Просмотреть файл

@@ -14,6 +14,7 @@ include_directories (SYSTEM  ${GLM_INCLUDE_DIRS})
14 14
 # Add glbinding Library
15 15
 find_package (glbinding REQUIRED)
16 16
 include_directories (SYSTEM ${GLBINDING_INCLUDES})
17
+# TODO REQUIRED has no effect and GLBINDING_LIBRARIES is empty?!
17 18
 set (GLBINDING_LIBRARIES "glbinding::glbinding")
18 19
 set (LIBS ${LIBS} ${GLBINDING_LIBRARIES})
19 20
 

+ 9
- 8
src/main.cpp Просмотреть файл

@@ -27,14 +27,15 @@
27 27
 #include <glbinding/Binding.h>
28 28
 #include <ezoptionparser/ezOptionParser.hpp>
29 29
 
30
-#ifdef DEBUG_GLBINDINGS
31
-#include <glbinding/callbacks.h>
30
+// TODO broken
31
+#ifdef ENABLE_GL_DEBUGGING
32
+#include <glbinding/CallbackMask.h>
32 33
 #include <glbinding/Meta.h>
33
-#endif
34
+#endif // ENABLE_GL_DEBUGGING
34 35
 
35 36
 static std::string configFileToUse;
36 37
 
37
-#ifdef DEBUG_GLBINDINGS
38
+#ifdef ENABLE_GL_DEBUGGING
38 39
 static void glErrorCallback(const glbinding::FunctionCall& call) {
39 40
     RunTime::incrementCallCount();
40 41
 
@@ -73,7 +74,7 @@ static void glUnresolvedCallback(const glbinding::AbstractFunction& func) {
73 74
     Log::get(LOG_ERROR) << "Unresolved OpenGL call: \"" << func.name() << "\"!" << Log::endl;
74 75
     orAssert(func.isResolved());
75 76
 }
76
-#endif
77
+#endif // ENABLE_GL_DEBUGGING
77 78
 
78 79
 int main(int argc, const char* argv[]) {
79 80
     ez::ezOptionParser opt;
@@ -121,19 +122,19 @@ int main(int argc, const char* argv[]) {
121 122
         opt.get("-c")->getString(configFileToUse);
122 123
     }
123 124
 
124
-    glbinding::Binding::initialize();
125
+    glbinding::Binding::initialize(nullptr);
125 126
     Log::initialize();
126 127
     RunTime::initialize(); // RunTime is required by other constructors
127 128
     Command::fillCommandList();
128 129
 
129
-#ifdef DEBUG_GLBINDINGS
130
+#ifdef ENABLE_GL_DEBUGGING
130 131
     // Register global OpenGL after-callback for all GL functions except glGetError
131 132
     glbinding::setCallbackMaskExcept(glbinding::CallbackMask::After
132 133
                                      | glbinding::CallbackMask::ParametersAndReturnValue,
133 134
     { "glGetError" });
134 135
     glbinding::setAfterCallback(glErrorCallback);
135 136
     glbinding::setUnresolvedCallback(glUnresolvedCallback);
136
-#endif
137
+#endif // ENABLE_GL_DEBUGGING
137 138
 
138 139
     Log::get(LOG_INFO) << "Initializing " << VERSION << Log::endl;
139 140
 

Загрузка…
Отмена
Сохранить