Пример #1
0
	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();
	}
Пример #2
0
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);
   }
}
Пример #3
0
	HouGeoAdapter::AttributePtr HouGeoAdapter::getGlobalAttribute( const std::string &name )
	{
		return AttributePtr();
	}
Пример #4
0
	AttributePtr Attribute::createFloat()
	{
		return AttributePtr( new Attribute(1, Attribute::FLOAT) );
	}
Пример #5
0
	AttributePtr Attribute::createInt()
	{
		return AttributePtr( new Attribute(1, Attribute::INT) );
	}
Пример #6
0
	AttributePtr Attribute::createMat44()
	{
		return AttributePtr( new Attribute(16, Attribute::FLOAT) );
	}
Пример #7
0
	AttributePtr Attribute::createVec2f( int numElements )
	{
		AttributePtr attr = AttributePtr( new Attribute(2, Attribute::FLOAT) );
		attr->resize(numElements);
		return attr;
	}
Пример #8
0
	AttributePtr Attribute::createMat33()
	{
		return AttributePtr( new Attribute(9, Attribute::FLOAT) );
	}
Пример #9
0
	AttributePtr Attribute::createSampler1d()
	{
		return AttributePtr( new Attribute(1, Attribute::SAMPLER, GL_TEXTURE_1D) );
	}
Пример #10
0
	AttributePtr Attribute::createSampler2dArray()
	{
		return AttributePtr( new Attribute(1, Attribute::SAMPLER, GL_TEXTURE_2D_ARRAY) );
	}
Пример #11
0
	AttributePtr Attribute::createSampler2dMS()
	{
		return AttributePtr( new Attribute(1, Attribute::SAMPLER, GL_TEXTURE_2D_MULTISAMPLE) );
	}
Пример #12
0
	AttributePtr Attribute::createSamplerCube()
	{
		return AttributePtr( new Attribute(1, Attribute::SAMPLER, GL_TEXTURE_CUBE_MAP) );
	}