浏览代码

changes to build and run on arch

Thomas Buck 5 个月前
父节点
当前提交
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
 
5
 
6
 build*
6
 build*
7
 .idea
7
 .idea
8
+.directory

+ 1
- 1
CMakeLists.txt 查看文件

52
 endif()
52
 endif()
53
 
53
 
54
 # Flags for all builds
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
 # Flags for Debug build
57
 # Flags for Debug build
58
 set (OpenRaider_CXX_FLAGS_DEBUG "${OpenRaider_CXX_FLAGS_DEBUG} -DDEBUG")
58
 set (OpenRaider_CXX_FLAGS_DEBUG "${OpenRaider_CXX_FLAGS_DEBUG} -DDEBUG")

+ 1
- 1
include/Log.h 查看文件

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

+ 1
- 0
src/CMakeLists.txt 查看文件

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

+ 9
- 8
src/main.cpp 查看文件

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

正在加载...
取消
保存