-------------------------------------------------------------------------------------- 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 --------------------------------------------------------------------------------------
| 274 | // false On error |
| 275 | // -------------------------------------------------------------------------------------- |
| 276 | bool 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: |