buffer mesh working

This commit is contained in:
2020-03-10 13:33:32 -04:00
parent a0803a3727
commit 54ea5dbd53
5 changed files with 35 additions and 66 deletions

View File

@@ -78,7 +78,7 @@ namespace cgl {
set_source(src);
if (!compile())
throw shader_error(get_info_log());
throw shader_error<mode>(get_info_log());
}
static shader<mode> file(const std::string &name) {
@@ -188,7 +188,7 @@ namespace cgl {
attach(sh);
if (!link())
throw shader_error(get_info_log());
throw shader_error<mode>(get_info_log());
detach(sh);
}

View File

@@ -15,6 +15,7 @@ public:
explicit gl_error(const char *string) : domain_error(string) {}
};
template<GLenum mode>
class shader_error : public gl_error {
public:
explicit shader_error(const std::string &arg) : gl_error(arg) {}
@@ -106,7 +107,7 @@ GLuint utilCompileFiles(const GLenum type, const std::vector<std::string> &files
if (getShaderCompileStatus(shader)) return shader;
throw shader_error(getShaderInfoLog(shader));
throw shader_error<GL_VERTEX_SHADER>(getShaderInfoLog(shader));
}
GLuint utilLinkProgram(const std::vector<GLuint> &shaders) {