Shader::Shader(const char* vsource, const char* fsource, const char* gsource) { m_Program = glCreateProgram(); addVertexShader(vsource); addFragmentShader(fsource); if(gsource!=NULL) { addGeometryShader(gsource); } bindAttributeLocations(); compileProgram(); }
void Shader::addGeometryShaderFromFile(const std::string& text) { addGeometryShader(*loadShader(text)); }