Quellcode durchsuchen

Adjusted include order, slop now checks OpenGL version.

naelstrof vor 7 Jahren
Ursprung
Commit
badecc298b
2 geänderte Dateien mit 8 neuen und 1 gelöschten Zeilen
  1. 1
    1
      CMakeLists.txt
  2. 7
    0
      src/slop.cpp

+ 1
- 1
CMakeLists.txt Datei anzeigen

21
 
21
 
22
 include_directories("${PROJECT_BINARY_DIR}")
22
 include_directories("${PROJECT_BINARY_DIR}")
23
 
23
 
24
-add_definitions(-DSLOP_VERSION="v6.3.45")
24
+add_definitions(-DSLOP_VERSION="v6.3.46")
25
 
25
 
26
 # The names have to be unique unfortunately.
26
 # The names have to be unique unfortunately.
27
 set(EXECUTABLE_NAME "slop")
27
 set(EXECUTABLE_NAME "slop")

+ 7
- 0
src/slop.cpp Datei anzeigen

1
+#include "gl_core_3_0.hpp"
2
+#include <GL/gl.h>
3
+
1
 #include <chrono>
4
 #include <chrono>
2
 #include <thread>
5
 #include <thread>
3
 
6
 
86
         // If we have a compositor, we try using OpenGL
89
         // If we have a compositor, we try using OpenGL
87
         try {
90
         try {
88
             window = new SlopWindow();
91
             window = new SlopWindow();
92
+	    if (!gl::sys::IsVersionGEQ(3,0)) {
93
+		delete window;
94
+                throw new std::runtime_error( "OpenGL version is not high enough, slop requires OpenGL 3.0!\nOpenGL accelleration is disabled. Use -o or -q to suppress this message." );
95
+	    }
89
             success = true;
96
             success = true;
90
         } catch( std::exception* e ) {
97
         } catch( std::exception* e ) {
91
             errorstring += std::string(e->what()) + "\n";
98
             errorstring += std::string(e->what()) + "\n";