PixelLightAPI
.
|
Abstract renderer buffer resource base class. More...
#include <Buffer.h>
Public Member Functions | |
virtual PLRENDERER_API | ~Buffer () |
Destructor. | |
PLCore::uint32 | GetNumOfElements () const |
Returns the number of buffer elements. | |
PLCore::uint32 | GetSize () const |
Returns the buffer size (in bytes) | |
Usage::Enum | GetUsage () const |
Returns the usage flag. | |
bool | IsManaged () const |
Returns whether the buffer is managed or not. | |
PLCore::uint16 | GetLockCount () const |
Returns the lock count. | |
virtual bool | IsAllocated () const =0 |
Returns whether the buffer is allocated or not. | |
virtual bool | Allocate (PLCore::uint32 nElements, Usage::Enum nUsage=Usage::Dynamic, bool bManaged=true, bool bKeepData=false)=0 |
Allocates the buffer. | |
virtual bool | Clear ()=0 |
Clears the buffer. | |
virtual void * | Lock (PLCore::uint32 nFlag=Lock::ReadWrite)=0 |
Locks the buffer. | |
virtual void * | GetData ()=0 |
Returns the buffer data. | |
virtual bool | Unlock ()=0 |
Unlocks the buffer. | |
Protected Member Functions | |
PLRENDERER_API | Buffer (Renderer &cRenderer, EType nType) |
Constructor. | |
bool | ForceUnlock () |
Forces immediately buffer unlock. | |
Protected Attributes | |
PLCore::uint32 | m_nElements |
PLCore::uint32 | m_nSize |
Usage::Enum | m_nUsage |
bool | m_bManaged |
PLCore::uint16 | m_nLockCount |
PLCore::uint64 | m_nLockStartTime |
Abstract renderer buffer resource base class.
virtual PLRENDERER_API PLRenderer::Buffer::~Buffer | ( | ) | [virtual] |
Destructor.
PLRENDERER_API PLRenderer::Buffer::Buffer | ( | Renderer & | cRenderer, |
EType | nType | ||
) | [protected] |
Constructor.
[in] | cRenderer | Owner renderer |
[in] | nType | Resource type |
PLCore::uint32 PLRenderer::Buffer::GetNumOfElements | ( | ) | const [inline] |
Returns the number of buffer elements.
PLCore::uint32 PLRenderer::Buffer::GetSize | ( | ) | const [inline] |
Usage::Enum PLRenderer::Buffer::GetUsage | ( | ) | const [inline] |
Returns the usage flag.
bool PLRenderer::Buffer::IsManaged | ( | ) | const [inline] |
Returns whether the buffer is managed or not.
PLCore::uint16 PLRenderer::Buffer::GetLockCount | ( | ) | const [inline] |
Returns the lock count.
virtual bool PLRenderer::Buffer::IsAllocated | ( | ) | const [pure virtual] |
Returns whether the buffer is allocated or not.
virtual bool PLRenderer::Buffer::Allocate | ( | PLCore::uint32 | nElements, |
Usage::Enum | nUsage = Usage::Dynamic , |
||
bool | bManaged = true , |
||
bool | bKeepData = false |
||
) | [pure virtual] |
Allocates the buffer.
[in] | nElements | Number of elements |
[in] | nUsage | Usage flag indicating the expected application usage pattern of the data store |
[in] | bManaged | If the render buffer is managed, for instance shadow buffers (system memory copies that allow for faster reads) are used internally. |
[in] | bKeepData | Should the current buffer content be restored after the buffer was reallocated? |
virtual bool PLRenderer::Buffer::Clear | ( | ) | [pure virtual] |
Clears the buffer.
virtual void* PLRenderer::Buffer::Lock | ( | PLCore::uint32 | nFlag = Lock::ReadWrite | ) | [pure virtual] |
Locks the buffer.
[in] | nFlag | Access flag which describes the operations which should be performed on the locked buffer. This can be any member of the lock enumeration type. |
virtual void* PLRenderer::Buffer::GetData | ( | ) | [pure virtual] |
Returns the buffer data.
Implemented in PLRenderer::VertexBuffer, PLRenderer::IndexBuffer, and PLRenderer::UniformBuffer.
virtual bool PLRenderer::Buffer::Unlock | ( | ) | [pure virtual] |
Unlocks the buffer.
bool PLRenderer::Buffer::ForceUnlock | ( | ) | [inline, protected] |
Forces immediately buffer unlock.
Forces immediately vertex buffer unlock.
PLCore::uint32 PLRenderer::Buffer::m_nElements [protected] |
Number of buffer elements
PLCore::uint32 PLRenderer::Buffer::m_nSize [protected] |
Buffer size (in bytes)
Usage::Enum PLRenderer::Buffer::m_nUsage [protected] |
Usage flag
bool PLRenderer::Buffer::m_bManaged [protected] |
Is the buffer managed?
PLCore::uint16 PLRenderer::Buffer::m_nLockCount [protected] |
Lock count
PLCore::uint64 PLRenderer::Buffer::m_nLockStartTime [protected] |
Time where the buffer was locked
|