Exemplo n.º 1
0
void GlShaderProgram::addShaderFromSourceCode(const GlShader::ShaderType shaderType, const std::string &shaderSrc) {
    GlShader *shader = new GlShader(shaderType);
    shader->setAnonymousCreation(true);
    shader->compileFromSourceCode(shaderSrc);
    addShader(shader);

}
Exemplo n.º 2
0
void GlShaderProgram::addGeometryShaderFromSourceCode(const std::string &geometryShaderSrc, GLenum inputPrimitiveType, GLenum outputPrimitiveType) {
  GlShader *shader = new GlShader(inputPrimitiveType, outputPrimitiveType);
  shader->setAnonymousCreation(true);
  shader->compileFromSourceCode(geometryShaderSrc);
  addShader(shader);
}