#include <RendererTypes.h>
Public Member Functions | |
virtual void | Duplicate (TRendererVertexBuffer **dest)=0 |
Duplicate pointer to this object to another one and increase number of references to it. | |
virtual DWORD | GetRefs (void) const =0 |
Returns number of references to this VB. | |
virtual DWORD | AddRefs (void)=0 |
Increases number of references and returns result. | |
virtual DWORD | Release (void)=0 |
Decreases number of references to this VB and return result. | |
virtual DWORD | GetCapacity (void) const =0 |
Returns number of vertices that can be stored in this vertex buffer. | |
virtual DWORD | GetVertexSize (void) const =0 |
Returns size of one vertex. | |
virtual DWORD | GetSize (void) const =0 |
Returns size of entire vertex bufer in bytes. | |
virtual DWORD | GetVerticesCount (void) const =0 |
Returns number of actually valid vertices in buffer. | |
virtual DWORD | GetFreeCapacity (void) const =0 |
Returns number of unused vertices in vertex buffer. | |
virtual BOOL | IsDynamic (void) const =0 |
Determines whether this vertex buffer is dynamic. | |
virtual BOOL | UpdateVertexBuffer (const void *data, DWORD startVertex, DWORD vertices)=0 |
Updates vertex buffer. | |
virtual BOOL | DiscardDynamicVertexBuffer (const void *data, DWORD startVertex, DWORD vertices)=0 |
This method update dynamic vertex buffer thus cannot be used for static vertex buffers. | |
virtual BOOL | AddToDynamicVertexBuffer (const void *data, DWORD vertices)=0 |
This method updates dynamic vertex buffer thus cannot be used for static vertex buffer. |
Definition at line 1317 of file RendererTypes.h.
|
Increases number of references and returns result.
|
|
This method updates dynamic vertex buffer thus cannot be used for static vertex buffer. Method adds data after last valid vertex in VB, but there must be enough space (see TRendererVertexBuffer::GetFreeCapacity()). If there isn't enough space for vertices then FASLE is returned. In this case you should add data to vertex buffer via calling TRendererVertexBuffer::DiscardDynamicVertexBuffer(), but be carefull, this method destroys previous data in vertex buffer. Method directly calls TRenderer::AddToDynamicVertexBuffer() method.
|
|
This method update dynamic vertex buffer thus cannot be used for static vertex buffers. After calling this method previous data in buffer are destroyed, but this method doesnt wait for device, thus device can render from previous vertex buffer and method copy data to new allocated buffer, which replace old buffer after rendering operation. It's good idea set STARTVERTEX to 0 and VERTICES to TRendererVertexBuffer::GetCapacity(), but at this moment DATA must contain enough data bytes. If STARTVERTEX or VERTICES parameter do not cover entire buffer then there will be undefined areas in vertex buffer. Last valid vertex (method TRendererVertexBuffer::GetVerticesCount()) is set always to (startVertex+vertices). Method directly calls TRenderer::DiscardDynamicVertexBuffer() method.
|
|
Duplicate pointer to this object to another one and increase number of references to it. This method does the same as copying two pointers and increasing number of references with calling AddRefs().
|
|
Returns number of vertices that can be stored in this vertex buffer.
|
|
Returns number of unused vertices in vertex buffer. This method is important only for dynamic VB, for static VB it returns always 0. |
|
Returns number of references to this VB.
|
|
Returns size of entire vertex bufer in bytes.
|
|
Returns size of one vertex.
|
|
Returns number of actually valid vertices in buffer. This method is important only for dynamic VB, for static VB it returns vertex buffer capacity as GetCapacity() method. |
|
Determines whether this vertex buffer is dynamic.
|
|
Decreases number of references to this VB and return result. If number of references count zero then VB is destroyed via operator delete. After calling this method pointer is invalid and MUST be set to NULL. |
|
Updates vertex buffer. Vertex buffer may be static or dynamic. ITS RECOMMNEDED USE THIS METHOD ONLY FOR STATIC VERTEX BUFFER, THERE ARE SPECIAL METHODS FOR DYNAMIC VERTEX BUFFERS. In static buffer this method check whether desired interval for vertices <startVertex,startVertex+vertices-1> is valid and then update this vertices. In dynamic buffer method does the same and moreover it change information about number of valid vertices in vertex buffer (method TRendererVertexBuffer::GetVerticesCount()). New interval of valid vertices is set as <0,startVertex+vertices-1> (method TRendererVertexBuffer::GetVerticesCount() returns startVertex+vertices) if original interval was less than new interval. In other case (original interval was higher) new interval is set to original interval - thus no change. Vertices outside changed interval are staying unchanged. This method is only way how to change static vertex buffer, for dynamic buffer is its efficiency low, its better idea use specialized method for changing dynamic vertex buffers. Method directly calls TRenderer::UpdateVertexBuffer() method.
|