13#ifndef SO_SHADER_BUILDER_H
14#define SO_SHADER_BUILDER_H
16#include "SoShaderSystem.h"
33 return code.size() > 0;
48 typedef std::map<std::string, SourceInfo> SourceInfoMap;
50 SourceInfoMap _repository;
75 const std::vector<std::string>& directives = std::vector<std::string>(),
81 const std::vector<std::string>& directives = std::vector<std::string>(),
83 int directivesFlag = FRAGMENT_SHADER | GEOMETRY_SHADER | VERTEX_SHADER);
89 std::ostringstream directives;
90 std::ostringstream header;
91 std::ostringstream body;
93 void addDirectived(
const std::vector<std::string>& directives);
95 std::string toString();
97 std::set<std::string> usedIncludes;
104 std::vector<SoShaderRepository*> _repositories;
std::vector< std::string > StringVector
Shader class which directly takes src for vertex, geometry and/or fragment shader,...
SoGLCompleteShader * createCompleteShader(const std::string name, const std::vector< std::string > &directives=std::vector< std::string >(), SoShaderRepository *repository=nullptr, int directivesFlag=FRAGMENT_SHADER|GEOMETRY_SHADER|VERTEX_SHADER)
Creates a complete shader from the given name (.VS, .FS and .GS are appended, VS and FS are required!...
std::string createShader(const std::string name, const std::vector< std::string > &directives=std::vector< std::string >(), SoShaderRepository *repository=nullptr)
Creates the shader source for the given shader.
void addRepository(SoShaderRepository *repository)
Adds the given repository, ownership stays with the caller.
void addSource(const char *data)
adds the given source to the default repository
void addSource(const char *data)
const SourceInfo & lookup(const std::string name) const
void insert(const std::string name, const SourceInfo &info)
Target mlrange_cast(Source arg)
Generic version of checked ML casts.