#pragma once #include #include #include #include #include #include #include namespace cgl{ template class shaderprogram : public program { public: shaderprogram() : program() { glProgramParameteri(id, GL_PROGRAM_SEPARABLE, GL_TRUE); } shaderprogram(const std::string &src) : shaderprogram() { shader sh(src); attach(sh); if (!link()) throw shader_error(get_info_log()); detach(sh); } static shaderprogram file(const std::string &name) { return shaderprogram(utilReadFile(name)); } }; namespace pgm { using vert = shaderprogram; using tcs = shaderprogram; using tes = shaderprogram; using geom = shaderprogram; using frag = shaderprogram; using comp = shaderprogram; } }