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

These things are not needed if you're not compiling with OpenGL.

Brian Callahan 8 лет назад
Родитель
Сommit
15e4b04535
2 измененных файлов: 8 добавлений и 0 удалений
  1. 4
    0
      src/main.cpp
  2. 4
    0
      src/shader.hpp

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

@@ -253,7 +253,9 @@ int app( int argc, char** argv ) {
253 253
     bool decorations = !options.nodecorations_flag;
254 254
     bool themeon = (bool)options.theme_given;
255 255
     std::string theme = options.theme_arg;
256
+#ifdef OPENGL_ENABLED
256 257
     bool shadergiven = (bool)options.shader_given;
258
+#endif
257 259
     std::string shader = options.shader_arg;
258 260
     struct timespec start, time;
259 261
     int xoffset = 0;
@@ -274,12 +276,14 @@ int app( int argc, char** argv ) {
274 276
     }
275 277
     std::string format = options.format_arg;
276 278
     bool magenabled = options.magnify_flag;
279
+#ifdef OPENGL_ENABLED
277 280
     float magstrength = options.magstrength_arg;
278 281
     if ( options.magpixels_arg < 0 ) {
279 282
         fprintf( stderr, "Error: --magpixels < 0, it's an unsigned integer you twat. Stop trying to underflow me!\n" );
280 283
         return EXIT_FAILURE;
281 284
     }
282 285
     unsigned int magpixels = (unsigned int)options.magpixels_arg;
286
+#endif
283 287
     cmdline_parser_free( &options );
284 288
 #ifndef OPENGL_ENABLED
285 289
     if ( opengl || themeon || magenabled ) {

+ 4
- 0
src/shader.hpp Просмотреть файл

@@ -6,9 +6,11 @@
6 6
 #include <string>
7 7
 #include <cstdio>
8 8
 #include <vector>
9
+#ifdef OPENGL_ENABLED
9 10
 #include <glm/glm.hpp>
10 11
 #include <glm/gtc/type_ptr.hpp>
11 12
 #include <GL/glew.h>
13
+#endif
12 14
 #include <string>
13 15
 #include <fstream>
14 16
 #include <streambuf>
@@ -25,9 +27,11 @@ public:
25 27
     void            unbind();
26 28
     void            setParameter( std::string name, int foo );
27 29
     void            setParameter( std::string name, float foo );
30
+#ifdef OPENGL_ENABLED
28 31
     void            setParameter( std::string name, glm::mat4 foo );
29 32
     void            setParameter( std::string name, glm::vec4 foo );
30 33
     void            setParameter( std::string name, glm::vec2 foo );
34
+#endif
31 35
     void            setAttribute( std::string name, unsigned int buffer, unsigned int stepsize );
32 36
     int             m_type;
33 37
 private: