Classes | |
struct | VertexAoS_t |
Public Types | |
enum | eUsage { USAGE_CHUNKMASK = 0xFF0 , USAGE_CHUNKMASKSHIFT = 4 , USAGE_TYPEMASK =0xF000 , USAGE_TYPEMASKSHIFT = 12 , USAGE_FLOAT1 = 0<<USAGE_CHUNKMASKSHIFT , USAGE_FLOAT2 = 1<<USAGE_CHUNKMASKSHIFT , USAGE_FLOAT3 = 2<<USAGE_CHUNKMASKSHIFT , USAGE_FLOAT4 = 3<<USAGE_CHUNKMASKSHIFT , USAGE_COLOR4 = 4<<USAGE_CHUNKMASKSHIFT , USAGE_POSITION =0<<USAGE_TYPEMASKSHIFT , USAGE_BLENDWEIGHT =1<<USAGE_TYPEMASKSHIFT , USAGE_BLENDINDICES =2<<USAGE_TYPEMASKSHIFT , USAGE_NORMAL =3<<USAGE_TYPEMASKSHIFT , USAGE_PSIZE =4<<USAGE_TYPEMASKSHIFT , USAGE_TEXCOORD =5<<USAGE_TYPEMASKSHIFT , USAGE_TANGENT =6<<USAGE_TYPEMASKSHIFT , USAGE_BINORMAL =7<<USAGE_TYPEMASKSHIFT , USAGE_TESSFACTOR =8<<USAGE_TYPEMASKSHIFT , USAGE_POSITIONT =9<<USAGE_TYPEMASKSHIFT , USAGE_COLOR =10<<USAGE_TYPEMASKSHIFT , USAGE_FOG =11<<USAGE_TYPEMASKSHIFT , USAGE_DEPTH =12<<USAGE_TYPEMASKSHIFT , USAGE_SAMPLE =13<<USAGE_TYPEMASKSHIFT , FLAGAOS_DONTCOPY_VERTICES = 1<<0 , FLAGAOS_DONTCOPY_ELEMENTS = 1<<1 , FLAGAOS_DONTCOPY_MEMBERS = 1<<2 , FLAGAOS_VERTICES_DYNAMIC = 1<<3 , FLAGAOS_ELEMENTS_32BIT = 1<<4 , FLAG_VERTEXDIRTY = 1<<30 , USAGE_END =0x7FFFFFFFU } |
Public Member Functions | |
const Burger::StaticRTTI * | get_StaticRTTI (void) const noexcept override |
Get the description to the class. | |
VertexBuffer () | |
Default constructor. | |
virtual | ~VertexBuffer () |
Default destructor. | |
uint_t | CheckLoad (Display *pDisplay) override=0 |
Upload vertex data from VRAM. | |
void | Release (Display *pDisplay) override=0 |
Release vertex data from VRAM. | |
uint_t | LoadData (Display *pDisplay, const VertexAoS_t *pDescription) |
Load vertex data to VRAM. | |
void | PurgeData (void) |
Release allocated memory buffers. | |
D3DVertexBuffer * | GetD3DVertexBuffer (void) const |
D3DVertexDeclaration * | GetD3DVertexDescription (void) const |
D3DIndexBuffer * | GetD3DIndexBuffer (void) const |
IDirect3DVertexBuffer9 * | GetDX9VertexBuffer (void) const |
IDirect3DVertexDeclaration9 * | GetDX9VertexDescription (void) const |
IDirect3DIndexBuffer9 * | GetDX9IndexBuffer (void) const |
uint_t | GetVertexArrayObject (void) const |
uint_t | GetElementID (void) const |
uint_t | GetBufferID (void) const |
uint_t | GetStride (void) const |
uint_t | GetArrayEntryCount (void) const |
uint_t | GetElementEntryCount (void) const |
Public Member Functions inherited from Burger::DisplayObject | |
DisplayObject * | GetNext (void) const |
Get the next display object in the global linked list. | |
DisplayObject * | GetPrevious (void) const |
Get the previous display object in the global linked list. | |
Public Member Functions inherited from Burger::ReferenceCounter | |
ReferenceCounter () noexcept | |
Sets the reference count to zero. | |
virtual | ~ReferenceCounter () |
Destructor. | |
void | AddRef (void) noexcept |
Increase the reference count by 1. | |
void | Release (void) noexcept |
Decrease the reference count by 1. | |
Public Member Functions inherited from Burger::Base | |
const char * | get_class_name (void) const noexcept |
Get the name of the class. | |
virtual | ~Base () noexcept=default |
Destructor. | |
Static Public Attributes | |
static const Burger::StaticRTTI | g_StaticRTTI |
static const uint_t | g_ChunkElementSizes [5] = {4,4,4,4,1} |
Size of each element for the USAGE_* chunk sizes. | |
static const uint_t | g_ChunkElementCounts [5] = {1,2,3,4,4} |
Number of elements for the USAGE_* chunks. | |
Static Public Attributes inherited from Burger::DisplayObject | |
static const Burger::StaticRTTI | g_StaticRTTI |
The global description of the class. | |
Static Public Attributes inherited from Burger::ReferenceCounter | |
static const Burger::StaticRTTI | g_StaticRTTI |
The global description of the class. | |
Static Public Attributes inherited from Burger::Base | |
static const Burger::StaticRTTI | g_StaticRTTI |
The global description of the class. | |
Protected Attributes | ||
const void * | m_pVertexArray | |
Pointer to the vertex data to upload, if NULL don't upload data. | ||
uintptr_t | m_uVertexArraySize | |
Size in bytes of the entire vertex buffer, if 0, don't generate vertex data. | ||
const void * | m_pElements | |
Pointer to the element index data to upload, NULL don't upload data. | ||
uintptr_t | m_uElementSize | |
Size in bytes of the entire element buffer, if 0, don't generate an element index array. | ||
const uint_t * | m_pMembers | |
Pointer to array of array description enumerations. | ||
D3DVertexBuffer * | m_pD3DVertexBuffer | |
(XBox 360 Only) DirectX vertex buffer | ||
D3DVertexDeclaration * | m_pD3DVertexDeclaration | |
(XBox 360 Only) DirectX vertex array description | ||
D3DIndexBuffer * | m_pD3DIndexBuffer | |
(XBox 360 Only) DirectX index buffer | ||
union { | ||
struct { | ||
IDirect3DVertexBuffer9 * m_pVertexBuffer | ||
DirectX 9 vertex buffer. More... | ||
IDirect3DVertexDeclaration9 * m_pDescription | ||
DirectX 9 vertex array description. More... | ||
IDirect3DIndexBuffer9 * m_pIndexBuffer | ||
DirectX 9 index buffer. More... | ||
} m_DX9 | ||
DirectX 9 specific data. More... | ||
struct { | ||
uint_t m_uVertexArrayObjectID | ||
(OpenGL only) Main Vertex Object Array More... | ||
uint_t m_uElementID | ||
(OpenGL only) ID to the index array More... | ||
uint_t m_uBufferID | ||
(OpenGL only) ID for the buffer More... | ||
} m_GL | ||
OpenGL specific data. More... | ||
} | m_Platform | |
Union of vertex buffer data for the platform. | ||
uint_t | m_uStride | |
Size in bytes of each entry in the vertex array. | ||
uint_t | m_uArrayEntryCount | |
Number of entries in the vertex array. | ||
uint_t | m_uElementEntryCount | |
Number of entries in the element array. | ||
uint_t | m_uMemberCount | |
Number of entries in the member array. | ||
uint_t | m_uFlags | |
Flags describing how to treat the data. | ||
Protected Attributes inherited from Burger::DisplayObject | ||
DisplayObject * | m_pNextDisplayObject | |
Pointer to the next DisplayObject. | ||
DisplayObject * | m_pPrevDisplayObject | |
Pointer to the previous DisplayObject. | ||
Private Member Functions | |
VertexBuffer (const VertexBuffer &)=delete | |
VertexBuffer & | operator= (const VertexBuffer &)=delete |
VertexBuffer (VertexBuffer &&)=delete | |
VertexBuffer & | operator= (VertexBuffer &&)=delete |
Additional Inherited Members | |
Static Public Member Functions inherited from Burger::DisplayObject | |
static DisplayObject * | GetFirstObject (void) |
Get the first display object in the global linked list. | |
static void | ReleaseAll (Display *pDisplay) |
Release all display objects. | |
Protected Member Functions inherited from Burger::DisplayObject | |
DisplayObject (void) | |
Add this display object to the global linked list. | |
virtual | ~DisplayObject () |
Remove this display object from the global linked list. | |
Static Protected Attributes inherited from Burger::DisplayObject | |
static DisplayObject * | g_pHead = NULL |
Global pointer to the linked list of display objects. | |
Enumerator | |
---|---|
USAGE_CHUNKMASK | Mask for the chunk type. |
USAGE_CHUNKMASKSHIFT | Shift for the chunk type. |
USAGE_TYPEMASK | Mask for the data type. |
USAGE_TYPEMASKSHIFT | Shift for the data type. |
USAGE_FLOAT1 | Data chunks is a single float. |
USAGE_FLOAT2 | Data chunks is 2 floats. |
USAGE_FLOAT3 | Data chunks is 3 floats. |
USAGE_FLOAT4 | Data chunks is 4 floats. |
USAGE_COLOR4 | Data chunks are color bytes (0-255 is 0.0f to 1.0f) |
USAGE_POSITION | Data type is a position. |
USAGE_BLENDWEIGHT | Data type is a blend weight. |
USAGE_BLENDINDICES | Data type is a blend index. |
USAGE_NORMAL | Data type is a vertex normal. |
USAGE_PSIZE | Data type is a point size. |
USAGE_TEXCOORD | Data type is a texture coordinate. |
USAGE_TANGENT | Data type is a vertex tangent. |
USAGE_BINORMAL | Data type is a vertex bi-normal. |
USAGE_TESSFACTOR | Data type is a tessellation factor. |
USAGE_POSITIONT | Data type is a transformed position. |
USAGE_COLOR | Data type is a vertex color. |
USAGE_FOG | Data type is a fog constant. |
USAGE_DEPTH | Data type is a depth value. |
USAGE_SAMPLE | Data type is a texture value. |
FLAGAOS_DONTCOPY_VERTICES | For VertexAoS_t, the m_pVertexArray entry is persistent, don't copy it. |
FLAGAOS_DONTCOPY_ELEMENTS | For VertexAoS_t, the m_pElements entry is persistent, don't copy it. |
FLAGAOS_DONTCOPY_MEMBERS | For VertexAoS_t, the m_pMembers entry is persistent, don't copy it. |
FLAGAOS_VERTICES_DYNAMIC | For VertexAoS_t, hint that the vertices will be modifed in future calls. |
FLAGAOS_ELEMENTS_32BIT | For VertexAoS_t, elements are 16 bit, unless this flag is set, and then they are 32 bits per entry. |
FLAG_VERTEXDIRTY | Internal flag, set when vertex data was changed and an upload is queued. |
USAGE_END | End of the data. |
|
privatedelete |
|
privatedelete |
Burger::VertexBuffer::VertexBuffer | ( | ) |
Default constructor.
Initialize to an empty vertex buffer
|
virtual |
Default destructor.
Release all data
Upload vertex data from VRAM.
If any data needed to be uploaded to VRAM, upload it.
pDisplay | Pointer to the parent display device |
Implements Burger::DisplayObject.
Implemented in Burger::VertexBufferDirectX9, and Burger::VertexBufferOpenGL.
|
overridevirtualnoexcept |
Get the description to the class.
This virtual function will pull the pointer to the StaticRTTI instance that has the name of the class. Due to it being virtual, it will be the name of the most derived class.
Reimplemented from Burger::DisplayObject.
Reimplemented in Burger::VertexBufferDirectX9, and Burger::VertexBufferOpenGL.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
uint_t BURGER_API Burger::VertexBuffer::LoadData | ( | Display * | pDisplay, |
const VertexAoS_t * | pDescription ) |
Load vertex data to VRAM.
Given a pointer to the display to render to and a structure describing the vertex data, upload the data to VRAM and retain information to allow rendering with graphics primitives
pDisplay | Pointer to the current display |
pDescription | Pointer to an initialized structure that describes the data to upload to VRAM. |
|
privatedelete |
|
privatedelete |
void BURGER_API Burger::VertexBuffer::PurgeData | ( | void | ) |
Release allocated memory buffers.
Clear out an allocated memory arrays from system memory. This function does not clear out platform specific data.
|
overridepure virtual |
Release vertex data from VRAM.
If any data was uploaded to VRAM, release it.
pDisplay | Pointer to the parent display device |
Implements Burger::DisplayObject.
Implemented in Burger::VertexBufferDirectX9, and Burger::VertexBufferOpenGL.
|
static |
Number of elements for the USAGE_* chunks.
|
static |
Size of each element for the USAGE_* chunk sizes.
|
static |
struct { ... } Burger::VertexBuffer::m_DX9 |
DirectX 9 specific data.
struct { ... } Burger::VertexBuffer::m_GL |
OpenGL specific data.
|
protected |
(XBox 360 Only) DirectX index buffer
|
protected |
(XBox 360 Only) DirectX vertex buffer
|
protected |
(XBox 360 Only) DirectX vertex array description
IDirect3DVertexDeclaration9* Burger::VertexBuffer::m_pDescription |
DirectX 9 vertex array description.
|
protected |
Pointer to the element index data to upload, NULL don't upload data.
IDirect3DIndexBuffer9* Burger::VertexBuffer::m_pIndexBuffer |
DirectX 9 index buffer.
union { ... } Burger::VertexBuffer::m_Platform |
Union of vertex buffer data for the platform.
|
protected |
Pointer to array of array description enumerations.
|
protected |
Pointer to the vertex data to upload, if NULL don't upload data.
IDirect3DVertexBuffer9* Burger::VertexBuffer::m_pVertexBuffer |
DirectX 9 vertex buffer.
|
protected |
Number of entries in the vertex array.
uint_t Burger::VertexBuffer::m_uBufferID |
(OpenGL only) ID for the buffer
|
protected |
Number of entries in the element array.
uint_t Burger::VertexBuffer::m_uElementID |
(OpenGL only) ID to the index array
|
protected |
Size in bytes of the entire element buffer, if 0, don't generate an element index array.
|
protected |
Flags describing how to treat the data.
|
protected |
Number of entries in the member array.
|
protected |
Size in bytes of each entry in the vertex array.
uint_t Burger::VertexBuffer::m_uVertexArrayObjectID |
(OpenGL only) Main Vertex Object Array
|
protected |
Size in bytes of the entire vertex buffer, if 0, don't generate vertex data.