/* ======================== idJointBuffer::Reference ======================== */ void idJointBuffer::Reference( const idJointBuffer & other ) { assert( IsMapped() == false ); assert( other.IsMapped() == false ); assert( other.GetAPIObject() != NULL ); assert( other.GetNumJoints() > 0 ); FreeBufferObject(); numJoints = other.GetNumJoints(); // this strips the MAPPED_FLAG offsetInOtherBuffer = other.GetOffset(); // this strips the OWNS_BUFFER_FLAG apiObject = other.apiObject; assert( OwnsBuffer() == false ); }
/* ======================== idIndexBuffer::Reference ======================== */ void idIndexBuffer::Reference( const idIndexBuffer & other ) { assert( IsMapped() == false ); //assert( other.IsMapped() == false ); // this happens when building idTriangles while at the same time setting up triIndex_t assert( other.GetAPIObject() != NULL ); assert( other.GetSize() > 0 ); FreeBufferObject(); size = other.GetSize(); // this strips the MAPPED_FLAG offsetInOtherBuffer = other.GetOffset(); // this strips the OWNS_BUFFER_FLAG apiObject = other.apiObject; assert( OwnsBuffer() == false ); }
void BufferObject::Release() { if (!IsClientSideBuffer()) FreeBufferObject(); m_type = BUFFEROBJECT_TYPE_VERTEX; m_usage = BUFFEROBJECT_USAGE_STATIC; m_bufferId = 0; m_isDirty = false; m_sizeInBytes = 0; GraphicsContextResource::Release(); }
/* ======================== idIndexBuffer::Reference ======================== */ void idIndexBuffer::Reference( const idIndexBuffer & other, int refOffset, int refSize ) { assert( IsMapped() == false ); //assert( other.IsMapped() == false ); // this happens when building idTriangles while at the same time setting up triIndex_t assert( other.GetAPIObject() != NULL ); assert( refOffset >= 0 ); assert( refSize >= 0 ); assert( refOffset + refSize <= other.GetSize() ); FreeBufferObject(); size = refSize; offsetInOtherBuffer = other.GetOffset() + refOffset; apiObject = other.apiObject; assert( OwnsBuffer() == false ); }
/* ======================== idJointBuffer::Reference ======================== */ void idJointBuffer::Reference( const idJointBuffer & other, int jointRefOffset, int numRefJoints ) { assert( IsMapped() == false ); assert( other.IsMapped() == false ); assert( other.GetAPIObject() != NULL ); assert( jointRefOffset >= 0 ); assert( numRefJoints >= 0 ); assert( jointRefOffset + numRefJoints * sizeof( idJointMat ) <= other.GetNumJoints() * sizeof( idJointMat ) ); assert_16_byte_aligned( numRefJoints * 3 * 4 * sizeof( float ) ); FreeBufferObject(); numJoints = numRefJoints; offsetInOtherBuffer = other.GetOffset() + jointRefOffset; apiObject = other.apiObject; assert( OwnsBuffer() == false ); }
void BufferObject::FreeFromGpu() { ASSERT(IsClientSideBuffer() == false); FreeBufferObject(); }
void BufferObject::RecreateOnGpu() { ASSERT(IsClientSideBuffer() == false); FreeBufferObject(); CreateBufferObject(); }
/* ======================== idJointBuffer::~idJointBuffer ======================== */ idJointBuffer::~idJointBuffer() { FreeBufferObject(); }
/* ======================== idIndexBuffer::~idIndexBuffer ======================== */ idIndexBuffer::~idIndexBuffer() { FreeBufferObject(); }
/* ======================== idVertexBuffer::~idVertexBuffer ======================== */ idVertexBuffer::~idVertexBuffer() { FreeBufferObject(); }