- // @todo Loop thru the array of vertex buffers
- // @todo Use AttributeDataProvider to get the attrs and enable them
- // Need mapping from gpu buffers index to a particular attributes
- Vector4 *vertex=0;
-
- unsigned int gpuBufferIndex = 0;
-
- GLint positionLoc = program.GetAttribLocation( Program::ATTRIB_POSITION );
- context.VertexAttribPointer( positionLoc,
- 2, // 2D position
- GL_FLOAT,
- GL_FALSE, // Not normalized
- mVertexBuffers[gpuBufferIndex]->GetStride(),
- &vertex->x );
-
- context.EnableVertexAttributeArray( positionLoc );
-
- GLint textureCoordsLoc = program.GetAttribLocation( Program::ATTRIB_TEXCOORD );
- context.VertexAttribPointer( textureCoordsLoc,
- 2, // Texture Coords = U, V
- GL_FLOAT,
- GL_FALSE,
- mVertexBuffers[gpuBufferIndex]->GetStride(),
- &vertex->z );
- context.EnableVertexAttributeArray( textureCoordsLoc );
+ OwnerContainer< RenderPropertyBuffer* >::Iterator it = mVertexBuffers.Begin();
+ OwnerContainer< RenderPropertyBuffer* >::ConstIterator end = mVertexBuffers.End();
+ for( ; it != end; ++it )
+ {
+ (*it)->EnableVertexAttributes( context, bufferIndex, program );
+ }