-------------------------------------------------------------------------------- Description: Create a vertex buffer, which acts as a instance buffer for the instanced rendering we use for turrets. Fill it just with an index for each instance. An instance is basiclly a single turret of this set. --------------------------------------------------------------------------------
| 324 | // An instance is basiclly a single turret of this set. |
| 325 | // -------------------------------------------------------------------------------- |
| 326 | void EveTurretSet::InitializeInstanceBuffer() |
| 327 | { |
| 328 | // release old and create new and fill it with 1, 2, 3, 4, ... |
| 329 | float pBufferData[EVE_MAX_TURRETS_PER_SET]; |
| 330 | for( unsigned int i = 0; i < EVE_MAX_TURRETS_PER_SET; ++i ) |
| 331 | { |
| 332 | pBufferData[i] = (float)i; |
| 333 | } |
| 334 | USE_MAIN_THREAD_RENDER_CONTEXT(); |
| 335 | |
| 336 | CR_RETURN( g_sharedBuffer.Allocate( |
| 337 | sizeof( float ), |
| 338 | EVE_MAX_TURRETS_PER_SET, |
| 339 | pBufferData, |
| 340 | renderContext, |
| 341 | m_instanceBuffer ) ); |
| 342 | } |
| 343 | |
| 344 | // -------------------------------------------------------------------------------- |
| 345 | // Description: |