#include <RendererTypes.h>
Public Member Functions | |
virtual void | Duplicate (TRendererIndexBuffer **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 IB and return result. | |
virtual DWORD | GetCapacity (void) const =0 |
Returns number of indices that can be stored in this vertex buffer. | |
virtual DWORD | GetSize (void) const =0 |
Returns size of entire index bufer in bytes. | |
virtual DWORD | GetIndexSize (void) const =0 |
This method always returns 2, because all indices are 16-bits (sizeof(short)==2). | |
virtual DWORD | GetIndicesCount (void) const =0 |
Returns number of actually valid indices in buffer. | |
virtual DWORD | GetFreeCapacity (void) const =0 |
Returns number of unused indices in index buffer. | |
virtual BOOL | IsDynamic (void) const =0 |
Determines whether this index buffer is dynamic. | |
virtual BOOL | UpdateIndexBuffer (const void *data, DWORD startIndex, DWORD indices)=0 |
Updates index buffer. | |
virtual BOOL | DisardDynamicIndexBuffer (const void *data, DWORD startIndex, DWORD indices)=0 |
This method update dynamic index buffer thus cannot be used for static index buffers. | |
virtual BOOL | AddToDynamicIndexBuffer (const void *data, DWORD indices)=0 |
This method updates dynamic index buffer thus cannot be used for static index buffer. |
Index buffer can be static or dynamic, but always have write-only access. All index buffers are instable, thus you must re-create all index buffers after device was lost. All indices are stored in VIDEO memory and all are renderable.
Index buffer object can be create only by renderer class and released via Release() method.
Index buffer may be filled with special renderer methods. See TRenderer class.
Definition at line 1433 of file RendererTypes.h.
|
Increases number of references and returns result.
|
|
This method updates dynamic index buffer thus cannot be used for static index buffer. This method directly calls TRenderer::AddToDynamicIndexBuffer() method. Method adds data after last valid index in IB, but there must be enough space (see TRendererIndexBuffer::GetFreeCapacity()). If there isn't enough space for vertices then FASLE is returned. In this case you should add data to index buffer via calling TRendererIndexBuffer::DiscardDynamicIndexBuffer(), but be carefull, this method destroys previous data in index buffer!!!
|
|
This method update dynamic index buffer thus cannot be used for static index buffers. This method directly calls TRenderer::DisardDynamicIndexBuffer() method. After calling this method previous data in buffer are destroyed, but this method doesnt wait for device, thus device can render from previous index buffer and method copy data to new allocated buffer, which replace old buffer after rendering operation. It's good idea set STARTINDEX to 0 and INDICES to TRendererIndexxBuffer::GetCapacity(), but at this moment DATA must contain enough data bytes. If STARTINDEX or INDICES parameter do not cover entire buffer then there will be undefined areas in index buffer. Last valid index (method TRendererIndexBuffer::GetIndicesCount()) is set always to (startIndexx+indices).
|
|
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 indices that can be stored in this vertex buffer.
|
|
Returns number of unused indices in index buffer. This method is important only for dynamic IB, for static IB it returns always 0. |
|
This method always returns 2, because all indices are 16-bits (sizeof(short)==2).
|
|
Returns number of actually valid indices in buffer. This method is important only for dynamic IB, for static IB it returns index buffer capacity as GetCapacity() method. |
|
Returns number of references to this VB.
|
|
Returns size of entire index bufer in bytes.
|
|
Determines whether this index buffer is dynamic.
|
|
Decreases number of references to this IB and return result. If number of references count zero then IB is destroyed via operator delete. After calling this method pointer is invalid and MUST be set to NULL. |
|
Updates index buffer. Index buffer may be static or dynamic. This method directly calls TRenderer::UpdateIndexBuffer() method. ITS RECOMMNEDED USE THIS METHOD ONLY FOR STATIC INDEX BUFFER, THERE ARE SPECIAL METHODS FOR DYNAMIC INDEX BUFFERS. In static buffer method check whether desired interval for indices <indexBuffer,indexBuffer+indices-1> is valid and then update this indices. In dynamic buffer method does the same and moreover it change information about number of valid indices in buffer (method TRendererIndexBuffer::GetIndicesCount()). New interval of valid indices is set as <0,startIndex+indices-1> (method TRendererVertexBuffer::GetIndicesCount() returns startIndex+indices) 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. Indices outside changed interval are staying unchanged. This method is only way how to change static index buffer, for dynamic buffer is its efficiency low, its better idea use specialized method for changing dynamic index buffers.
|