6 #ifndef MATERIALX_SHADER_H
7 #define MATERIALX_SHADER_H
42 const string&
getName()
const {
return _name; }
54 bool hasStage(
const string& name);
60 const ShaderStage& getStage(
const string& name)
const;
65 return _attributeMap.count(attrib) != 0;
72 auto it = _attributeMap.find(attrib);
73 return it != _attributeMap.end() ? it->second :
nullptr;
79 _attributeMap[attrib] =
value;
85 _attributeMap[attrib] = Value::createValue<bool>(
true);
bool hasClassification(unsigned int c) const
Return true if this shader matches the given classification.
#define MATERIALX_NAMESPACE_BEGIN
ValuePtr getAttribute(const string &attrib) const
GLsizei const GLfloat * value
shared_ptr< const Syntax > ConstSyntaxPtr
Shared pointer to a constant Syntax.
void setSourceCode(const string &code, const string &stage=Stage::PIXEL)
Set the shader source code for a given shader stage.
bool hasAttribute(const string &attrib) const
Return true if the shader has a given named attribute.
size_t numStages() const
Return the number of shader stages for this shader.
std::unordered_map< string, ShaderStagePtr > _stagesMap
vector< ShaderStage * > _stages
ShaderGraph & getGraph()
Return the shader graph.
std::unordered_map< string, ValuePtr > _attributeMap
virtual ~Shader()
Destructor.
GLuint const GLchar * name
shared_ptr< class ShaderGraph > ShaderGraphPtr
A shared pointer to a shader graph.
MX_GENSHADER_API const string PIXEL
void setAttribute(const string &attrib)
Set a flag attribute on the shader.
shared_ptr< ShaderStage > ShaderStagePtr
Shared pointer to a ShaderStage.
void setAttribute(const string &attrib, ValuePtr value)
Set a value attribute on the shader.
#define MATERIALX_NAMESPACE_END
const string & getName() const
Return the shader name.
const ShaderGraph & getGraph() const
Return the shader graph.
const string & getSourceCode(const string &stage=Stage::PIXEL) const
Return the shader source code for a given shader stage.
shared_ptr< Value > ValuePtr
A shared pointer to a Value.