|
|
@@ -28,6 +28,8 @@ namespace {
|
|
|
struct error_formatter {
|
|
|
void operator()() const;
|
|
|
static void shader_error(GLuint id, std::string const & path);
|
|
|
+ static void shader_program_error(GLuint id, std::string const & frag_path,
|
|
|
+ std::string const & vert_path);
|
|
|
|
|
|
GLuint obj;
|
|
|
std::string fileName, path, eNoticeMessage, eFileMessage, eWindowTitle;
|
|
|
@@ -102,6 +104,21 @@ namespace {
|
|
|
glGetShaderiv,
|
|
|
glGetShaderInfoLog}();
|
|
|
}
|
|
|
+
|
|
|
+ void error_formatter::shader_program_error(GLuint id,
|
|
|
+ std::string const & frag_path,
|
|
|
+ std::string const & vert_path) {
|
|
|
+ std::string fileName = frag_path.substr(frag_path.find_last_of("/"));
|
|
|
+ error_formatter{id,
|
|
|
+ fileName,
|
|
|
+ frag_path,
|
|
|
+ "GLSL program link error!",
|
|
|
+ "File location of vertex shader: " + vert_path +
|
|
|
+ "\nFile location of fragment shader: " + frag_path,
|
|
|
+ "GLSL Link Error",
|
|
|
+ glGetProgramiv,
|
|
|
+ glGetProgramInfoLog}();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
namespace graphics { namespace textures {
|
|
|
@@ -259,7 +276,8 @@ namespace graphics { namespace shaders {
|
|
|
glGetProgramiv(id, GL_LINK_STATUS, &return_code);
|
|
|
|
|
|
if (return_code != GL_TRUE) {
|
|
|
- // LogShaderProgramError(*id, vertPath, fragPath);
|
|
|
+ error_formatter::shader_program_error(id, fragmentShader.actual().path,
|
|
|
+ vertexShader.actual().path);
|
|
|
throw linker_error("Could not link shader program");
|
|
|
}
|
|
|
return id;
|