|
|
@@ -25,7 +25,7 @@
|
|
|
namespace {
|
|
|
typedef void (*GLGetIntFor)(GLuint, GLenum, GLint *);
|
|
|
typedef void (*GLGetLog)(GLuint, GLsizei, GLsizei *, GLchar *);
|
|
|
- struct opengl_error_formatter {
|
|
|
+ struct error_formatter {
|
|
|
void operator()() const;
|
|
|
static void shader_error(GLuint id, std::string const & path);
|
|
|
|
|
|
@@ -35,7 +35,7 @@ namespace {
|
|
|
GLGetLog getInfoLog;
|
|
|
};
|
|
|
|
|
|
- void opengl_error_formatter::operator()() const {
|
|
|
+ void error_formatter::operator()() const {
|
|
|
std::stringstream errorString;
|
|
|
std::string errorLineNumber;
|
|
|
|
|
|
@@ -91,17 +91,16 @@ namespace {
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
- void opengl_error_formatter::shader_error(GLuint id,
|
|
|
- std::string const & path) {
|
|
|
+ void error_formatter::shader_error(GLuint id, std::string const & path) {
|
|
|
std::string fileName = path.substr(path.find_last_of("/"));
|
|
|
- opengl_error_formatter{id,
|
|
|
- fileName,
|
|
|
- path,
|
|
|
- "GLSL shader compile error!",
|
|
|
- "File location" + path,
|
|
|
- "GLSL Compile Error in " + fileName,
|
|
|
- glGetShaderiv,
|
|
|
- glGetShaderInfoLog}();
|
|
|
+ error_formatter{id,
|
|
|
+ fileName,
|
|
|
+ path,
|
|
|
+ "GLSL shader compile error!",
|
|
|
+ "File location" + path,
|
|
|
+ "GLSL Compile Error in " + fileName,
|
|
|
+ glGetShaderiv,
|
|
|
+ glGetShaderInfoLog}();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -230,7 +229,7 @@ namespace graphics { namespace shaders {
|
|
|
glGetShaderiv(id, GL_COMPILE_STATUS, &return_code);
|
|
|
|
|
|
if (return_code != GL_TRUE) {
|
|
|
- opengl_error_formatter::shader_error(id, abs_path);
|
|
|
+ error_formatter::shader_error(id, abs_path);
|
|
|
throw compilation_error("Could not compile the shader file");
|
|
|
}
|
|
|
return id;
|