Ejemplo n.º 1
0
Batch::Batch( const geom::Source &source, const gl::GlslProgRef &glsl, const AttributeMapping &attributeMapping )
	: mGlsl( glsl )
{
	geom::AttribSet attribs;
	// include all the attributes in the custom attributeMapping
	for( const auto &attrib : attributeMapping ) {
		if( source.getAttribDims( attrib.first ) )
			attribs.insert( attrib.first );
	}
	// and then the attributes references by the GLSL
	for( const auto &attrib : glsl->getActiveAttributes() ) {
		if( source.getAttribDims( attrib.getSemantic() ) )
			attribs.insert( attrib.getSemantic() );
	}
	mVboMesh = gl::VboMesh::create( source, attribs );
	initVao( attributeMapping );
}