Do not output the shader compile log if it is empty.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 12 Oct 2012 20:22:07 +0000 (22:22 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 12 Oct 2012 20:22:07 +0000 (22:22 +0200)
util.cpp

index 1c47e11..9eaa262 100644 (file)
--- a/util.cpp
+++ b/util.cpp
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <string.h>
 #include <assert.h>
 
 #include <math.h>
@@ -88,7 +89,9 @@ GLuint compile_shader(const std::string &shader_src, GLenum type)
        GLsizei log_length = sizeof(info_log) - 1;
        glGetShaderInfoLog(obj, log_length, &log_length, info_log);
        info_log[log_length] = 0; 
-       printf("shader compile log: %s\n", info_log);
+       if (strlen(info_log) > 0) {
+               printf("shader compile log: %s\n", info_log);
+       }
 
        GLint status;
        glGetShaderiv(obj, GL_COMPILE_STATUS, &status);