| 369 | } |
| 370 | |
| 371 | GFXVertexBuffer *GFXGLDevice::allocVertexBuffer( U32 numVerts, |
| 372 | const GFXVertexFormat *vertexFormat, |
| 373 | U32 vertSize, |
| 374 | GFXBufferType bufferType, |
| 375 | void* data ) |
| 376 | { |
| 377 | PROFILE_SCOPE(GFXGLDevice_allocVertexBuffer); |
| 378 | if(bufferType == GFXBufferTypeVolatile) |
| 379 | return findVolatileVBO(numVerts, vertexFormat, vertSize); |
| 380 | |
| 381 | GFXGLVertexBuffer* buf = new GFXGLVertexBuffer( GFX, numVerts, vertexFormat, vertSize, bufferType ); |
| 382 | buf->registerResourceWithDevice(this); |
| 383 | |
| 384 | if(data) |
| 385 | { |
| 386 | void* dest; |
| 387 | buf->lock(0, numVerts, &dest); |
| 388 | dMemcpy(dest, data, vertSize * numVerts); |
| 389 | buf->unlock(); |
| 390 | } |
| 391 | |
| 392 | return buf; |
| 393 | } |
| 394 | |
| 395 | GFXPrimitiveBuffer *GFXGLDevice::allocPrimitiveBuffer( U32 numIndices, U32 numPrimitives, GFXBufferType bufferType, void* data ) |
| 396 | { |
no test coverage detected