MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetBatchesImpl

Method GetBatchesImpl

trinity/Tr2SolidSet.cpp:137–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135
136
137void Tr2SolidSet::GetBatchesImpl( ITriRenderBatchAccumulator* accumulator, const Tr2PerObjectData* perObjectData, Tr2Material* effect, GetBatchesReason reason )
138{
139 if( !m_vertexBuffer.IsValid() )
140 {
141 return;
142 }
143
144 if( m_vertexDeclHandle == Tr2EffectStateManager::UNINITIALIZED_DECLARATION )
145 {
146 return;
147 }
148
149 Tr2RenderBatch batch;
150 batch.SetMaterial( effect );
151 batch.SetPerObjectData( perObjectData );
152 batch.SetVertexDeclaration( m_vertexDeclHandle );
153 batch.SetStreamSource( 0, m_vertexBuffer, sizeof( TriangleVertex ) );
154 batch.SetDrawInstanced( m_currentSubmittedTriangleCount * 3, 1, 0, 0 );
155 accumulator->Commit( batch );
156}
157
158void Tr2SolidSet::AddTriangle( const Vector3& position1, const Vector4& color1, const Vector3& position2, const Vector4& color2, const Vector3& position3, const Vector4& color3 )
159{

Callers

nothing calls this directly

Calls 7

SetVertexDeclarationMethod · 0.80
SetDrawInstancedMethod · 0.80
IsValidMethod · 0.45
SetMaterialMethod · 0.45
SetPerObjectDataMethod · 0.45
SetStreamSourceMethod · 0.45
CommitMethod · 0.45

Tested by

no test coverage detected