comparison Framework/OpenGL/OpenGLShader.cpp @ 584:434ceeb0bcab

layers: InfoPanel, Polyline, Texture
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 19 Apr 2019 17:36:00 +0200
parents fadacfbf5538
children 6da17230c7a3
comparison
equal deleted inserted replaced
583:f9ac154c5a63 584:434ceeb0bcab
51 51
52 // Check if there were errors 52 // Check if there were errors
53 int infoLen = 0; 53 int infoLen = 0;
54 glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen); 54 glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
55 55
56 if (infoLen > 1) 56 if (infoLen > 0)
57 { 57 {
58 char infoLog[infoLen + 1]; 58 std::string infoLog;
59 glGetShaderInfoLog(shader, infoLen, NULL, infoLog); 59 infoLog.resize(infoLen + 1);
60 glGetShaderInfoLog(shader, infoLen, NULL, &infoLog[0]);
60 glDeleteShader(shader); 61 glDeleteShader(shader);
61 62
62 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, 63 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
63 "Error while creating an OpenGL shader: " + std::string(infoLog)); 64 "Error while creating an OpenGL shader: " + infoLog);
64 } 65 }
65 else 66 else
66 { 67 {
67 return shader; 68 return shader;
68 } 69 }