AttributePtr Shader::getUniform( const std::string &name ) { std::map<std::string, AttributePtr>::iterator it = m_uniforms.find( name ); if(it != m_uniforms.end()) return it->second; return AttributePtr(); }
AttributePtr gen_text(const RuleTable& print_rules, NodePtr root, BindingsPtr bindings) { const Rules& rules(bindings->get_rules()); std::ostringstream os; if (rules.operator_rules_defined()) { NodePtr cloned_root = clone_including_attributes(root); /* the parentheses operator can be configured through the operator set named "parentheses"; Op::LPAREN is taken by default */ OperatorSetPtr parenthesesSet = rules.get_opset("parentheses"); Operator parentheses; if (parenthesesSet && parenthesesSet->get_card() == 1) { OperatorSet::Iterator it = parenthesesSet->begin(); parentheses = Operator(*it); } else { parentheses = Op::LPAREN; } parenthesize(cloned_root, rules.get_operator_table(), parentheses); root = cloned_root; } if (print(os, root, print_rules, bindings)) { return std::make_shared<Attribute>(os.str()); } else { return AttributePtr(nullptr); } }
HouGeoAdapter::AttributePtr HouGeoAdapter::getGlobalAttribute( const std::string &name ) { return AttributePtr(); }
AttributePtr Attribute::createFloat() { return AttributePtr( new Attribute(1, Attribute::FLOAT) ); }
AttributePtr Attribute::createInt() { return AttributePtr( new Attribute(1, Attribute::INT) ); }
AttributePtr Attribute::createMat44() { return AttributePtr( new Attribute(16, Attribute::FLOAT) ); }
AttributePtr Attribute::createVec2f( int numElements ) { AttributePtr attr = AttributePtr( new Attribute(2, Attribute::FLOAT) ); attr->resize(numElements); return attr; }
AttributePtr Attribute::createMat33() { return AttributePtr( new Attribute(9, Attribute::FLOAT) ); }
AttributePtr Attribute::createSampler1d() { return AttributePtr( new Attribute(1, Attribute::SAMPLER, GL_TEXTURE_1D) ); }
AttributePtr Attribute::createSampler2dArray() { return AttributePtr( new Attribute(1, Attribute::SAMPLER, GL_TEXTURE_2D_ARRAY) ); }
AttributePtr Attribute::createSampler2dMS() { return AttributePtr( new Attribute(1, Attribute::SAMPLER, GL_TEXTURE_2D_MULTISAMPLE) ); }
AttributePtr Attribute::createSamplerCube() { return AttributePtr( new Attribute(1, Attribute::SAMPLER, GL_TEXTURE_CUBE_MAP) ); }