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

Method CreateVertexBuffer

trinity/Particle/Tr2ParticleSystem.cpp:276–292  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------- Description: Create a vertex buffer for particle data if needed. Return value: true If the buffer was created or is not needed false On error --------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

274// false On error
275// --------------------------------------------------------------------------------------
276bool Tr2ParticleSystem::CreateVertexBuffer()
277{
278 USE_MAIN_THREAD_RENDER_CONTEXT();
279 if( m_maxParticleCount > 0 && m_vertexSizes[Tr2ParticleElementData::GPU] > 0 )
280 {
281 CR_RETURN_VAL( m_vertexBuffer.Create(
282 m_vertexSizes[Tr2ParticleElementData::GPU] * sizeof( float ),
283 m_maxParticleCount,
284 Tr2GpuUsage::VERTEX_BUFFER,
285 Tr2CpuUsage::WRITE_OFTEN,
286 nullptr,
287 renderContext ),
288 false );
289 m_bufferDirty = true;
290 }
291 return true;
292}
293
294// --------------------------------------------------------------------------------------
295// Description:

Callers

nothing calls this directly

Calls 1

CreateMethod · 0.45

Tested by

no test coverage detected