MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / allocPrimitiveBuffer

Method allocPrimitiveBuffer

Engine/source/gfx/gl/gfxGLDevice.cpp:395–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395GFXPrimitiveBuffer *GFXGLDevice::allocPrimitiveBuffer( U32 numIndices, U32 numPrimitives, GFXBufferType bufferType, void* data )
396{
397 GFXPrimitiveBuffer* buf;
398
399 if(bufferType == GFXBufferTypeVolatile)
400 {
401 buf = findVolatilePBO(numIndices, numPrimitives);
402 }
403 else
404 {
405 buf = new GFXGLPrimitiveBuffer(GFX, numIndices, numPrimitives, bufferType);
406 buf->registerResourceWithDevice(this);
407 }
408
409 if(data)
410 {
411 void* dest;
412 buf->lock(0, numIndices, &dest);
413 dMemcpy(dest, data, sizeof(U16) * numIndices);
414 buf->unlock();
415 }
416 return buf;
417}
418
419void GFXGLDevice::setVertexStream( U32 stream, GFXVertexBuffer *buffer )
420{

Callers 2

setMethod · 0.45
immutableMethod · 0.45

Calls 4

dMemcpyFunction · 0.50
lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected