"L. Spiro Engine"
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | Friends

lsg::CVertexBuffer Class Reference

A vertex buffer. More...

#include <LSGVertexBuffer.h>

Inheritance diagram for lsg::CVertexBuffer:
lsg::CDirectX11VertexBuffer lsg::CVertexBufferBase

List of all members.

Public Member Functions

CVertexBuffer &LSE_CALL operator= (const CVertexBuffer &_vbOther)
LSBOOL LSE_CALL CreateVertexBuffer (const LSG_VB_CONTENTS &_vcContents, LSUINT32 _ui32UsageAndAccess=0UL, LSUINT32 _ui32InitialElements=0UL, CAllocator *_paAllocator=NULL)
LSVOID LSE_CALL Reset ()
LSVOID LSE_CALL SetAllocator (CAllocator *_paAllocator)
LSBOOL LSE_CALL Finalize ()
LSBOOL LSE_CALL Lock ()
LSVOID LSE_CALL UnLock ()
LSVOID LSE_CALL ChopTo (LSUINT32 _ui32Total)
LSE_INLINE LSUINT32 LSE_CALL TotalPrimitives () const
LSE_INLINE LSUINT32 LSE_CALL TotalElements () const
LSE_INLINE LSUINT32 LSE_CALL Stride () const
LSE_INLINE LSUINT32 LSE_CALL GetUsage () const
LSE_INLINE LSUINT32 LSE_CALL GetId () const
LSE_INLINE LSBOOL LSE_CALL Finalized () const
LSBOOL LSE_CALL AddVertex (LSUINT32 _ui32Index, LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSUINT32 _ui32Stream=0UL)
LSE_INLINE LSVOID LSE_CALL SetVertex (LSUINT32 _ui32Index, LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSUINT32 _ui32Stream=0UL)
LSBOOL LSE_CALL AddVertex (LSUINT32 _ui32Index, LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSREAL _fW, LSUINT32 _ui32Stream=0UL)
LSE_INLINE LSVOID LSE_CALL SetVertex (LSUINT32 _ui32Index, LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSREAL _fW, LSUINT32 _ui32Stream=0UL)
LSBOOL LSE_CALL AddNormal (LSUINT32 _ui32Index, LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSUINT32 _ui32Stream=0UL)
LSE_INLINE LSVOID LSE_CALL SetNormal (LSUINT32 _ui32Index, LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSUINT32 _ui32Stream=0UL)
LSBOOL LSE_CALL AddColor (LSUINT32 _ui32Index, LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSUINT32 _ui32Stream=0UL)
LSE_INLINE LSVOID LSE_CALL SetColor (LSUINT32 _ui32Index, LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSUINT32 _ui32Stream=0UL)
LSBOOL LSE_CALL AddAlpha (LSUINT32 _ui32Index, LSREAL _fA, LSUINT32 _ui32Stream=0UL)
LSE_INLINE LSVOID LSE_CALL SetAlpha (LSUINT32 _ui32Index, LSREAL _fA, LSUINT32 _ui32Stream=0UL)
LSBOOL LSE_CALL AddTex (LSUINT32 _ui32Index, LSREAL _fU, LSREAL _fV, LSUINT32 _ui32Stream=0UL)
LSE_INLINE LSVOID LSE_CALL SetTex (LSUINT32 _ui32Index, LSREAL _fU, LSREAL _fV, LSUINT32 _ui32Stream=0UL)
LSBOOL LSE_CALL AddFog (LSUINT32 _ui32Index, LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSUINT32 _ui32Stream=0UL)
LSE_INLINE LSVOID LSE_CALL SetFog (LSUINT32 _ui32Index, LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSUINT32 _ui32Stream=0UL)
LSBOOL LSE_CALL AddBiNormal (LSUINT32 _ui32Index, LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSUINT32 _ui32Stream=0UL)
LSE_INLINE LSVOID LSE_CALL SetBiNormal (LSUINT32 _ui32Index, LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSUINT32 _ui32Stream=0UL)
LSBOOL LSE_CALL AddTangent (LSUINT32 _ui32Index, LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSUINT32 _ui32Stream=0UL)
LSE_INLINE LSVOID LSE_CALL SetTangent (LSUINT32 _ui32Index, LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSUINT32 _ui32Stream=0UL)
LSBOOL LSE_CALL AddBlendWeight (LSUINT32 _ui32Index, LSREAL _f0, LSREAL _f1, LSREAL _f2, LSREAL _f3, LSUINT32 _ui32Stream=0UL)
LSE_INLINE LSVOID LSE_CALL SetBlendWeight (LSUINT32 _ui32Index, LSREAL _f0, LSREAL _f1, LSREAL _f2, LSREAL _f3, LSUINT32 _ui32Stream=0UL)
LSE_INLINE CVector3 LSE_CALL GetVertex3 (LSUINT32 _ui32Index, LSUINT32 _ui32Slot=0UL)
LSE_INLINE CVector3 LSE_CALL GetNormal (LSUINT32 _ui32Index, LSUINT32 _ui32Slot=0UL)
LSE_INLINE CVector2 LSE_CALL GetTex2 (LSUINT32 _ui32Index, LSUINT32 _ui32Slot=0UL)
LSE_INLINE LSUINT32 LSE_CALL GetElementSize () const
LSE_INLINE const LSVOID *LSE_CALL GetElement (LSUINT32 _ui32Index) const
LSE_INLINE LSVOID LSE_CALL MoveElement (LSUINT32 _ui32Index, LSUINT32 _ui32DestIndex)
LSBOOL LSE_CALL TransferElement (CVertexBuffer &_vbTarget, LSG_VERTEX_ATTRIBUTES _vaElementType, LSUINT32 _ui32Slot)
LSVOID *LSE_CALL GetBuffer ()
LSUINT32 LSE_CALL GetBufferLen ()

Static Public Member Functions

static LSVOID LSE_CALL ActivateVertexBuffer (CVertexBuffer &_vbBuffer, LSUINT32 _ui32Stream=0UL, LSUINT32 _ui32ElementOffset=0UL)
static LSVOID LSE_CALL DeActivateVertexBuffer (LSUINT32 _ui32Stream)

Protected Member Functions

LSBOOL LSE_CALL Activate (LSUINT32 _ui32Stream=0UL, LSUINT32 _ui32ElementOffset=0UL)
LSUINT32 LSE_CALL GetAttributesSize (const LSG_VB_CONTENTS &_vcContents)
LSVOID LSE_CALL CalculateAttributeOffsets ()
LSUINT32 LSE_CALL GetSingleAttributesSize (const LSG_VB_CONTENTS &_vcContents)
LSBOOL LSE_CALL AddIndex (LSUINT32 _ui32Index)
LSVOID LSE_CALL SortContents ()

Static Protected Member Functions

static LSINT32 LSE_CCALL ContentsSort (LSVOID *_pvContext, LSUINT8 *_pui8Left, LSUINT8 *_pui8Right)
static LSVOID LSE_CALL ClearVertexArray ()

Static Protected Attributes

static CVertexBufferm_pvbVertexBuffers [LSG_VBM_MAX_STREAMS]
static LSUINT32 m_ui32HighestVertexBuffer

Friends

class CFnd
class CDirectX11VertexBuffer

Detailed Description

A vertex buffer.

Class CVertexBuffer Description: A vertex buffer. The base class for this depends on the graphics API. We do not use polymorpism here, though in debug mode some functions will be virtual as a means of ensuring the API interface matches between all underlying API vertex buffer classes. Using a vertex buffer is simple: #1: Specify the buffer properties. #2: Fill it with vertex data. #3: Call Finalize() and it is ready to be used for rendering. Before Finalize() is called, you can still add vertices even if you specified a buffer with the LSG_VBAF_READ_ONLY flag. This flag is used only after the vertex data is uploaded to the hardware, which happens after a call to Finalize().


Member Function Documentation

LSBOOL LSE_CALL lsg::CVertexBuffer::Activate ( LSUINT32  _ui32Stream = 0UL,
LSUINT32  _ui32ElementOffset = 0UL 
) [protected]

Activate the vertex buffer to a given stream.

Parameters:
_ui32StreamThe stream on which to activate the vertex buffer.
_ui32ElementOffsetThe element within the buffer at which to start rendering when rendering is performed.
Returns:
Returns true if activation succeeded.
static LSVOID LSE_CALL lsg::CVertexBuffer::ActivateVertexBuffer ( CVertexBuffer _vbBuffer,
LSUINT32  _ui32Stream = 0UL,
LSUINT32  _ui32ElementOffset = 0UL 
) [static]

Apply a vertex buffer to a given stream.

Parameters:
_vbBufferThe vertex buffer to activate on the given stream.
_ui32StreamThe stream to which to apply the vertex buffer.
_ui32ElementOffsetThe element within the buffer at which to start rendering when rendering is performed.
LSBOOL LSE_CALL lsg::CVertexBuffer::AddAlpha ( LSUINT32  _ui32Index,
LSREAL  _fA,
LSUINT32  _ui32Stream = 0UL 
)

Add the alpha color value at the given index. If the buffer is not large enough it will be reallocated. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the alpha value.
_fAAlpha value.
_ui32StreamStream of the alpha value.
Returns:
Returns true if there is enough memory to add the alpha value.
LSBOOL LSE_CALL lsg::CVertexBuffer::AddBiNormal ( LSUINT32  _ui32Index,
LSREAL  _fX,
LSREAL  _fY,
LSREAL  _fZ,
LSUINT32  _ui32Stream = 0UL 
)

Add a bi-normal at the given index. If the buffer is not large enough it will be reallocated. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the bi-normal.
_fXX position of the bi-normal.
_fYY position of the bi-normal.
_fZZ position of the bi-normal.
_ui32StreamStream of the bi-normal.
Returns:
Returns true if there is enough memory to add the bi-normal.
LSBOOL LSE_CALL lsg::CVertexBuffer::AddBlendWeight ( LSUINT32  _ui32Index,
LSREAL  _f0,
LSREAL  _f1,
LSREAL  _f2,
LSREAL  _f3,
LSUINT32  _ui32Stream = 0UL 
)

Add a blend weight at the given index. If the buffer is not large enough it will be reallocated. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the blend weight.
_f0Blend weight 0.
_f1Blend weight 1.
_f2Blend weight 2.
_f3Blend weight 3.
_ui32StreamStream of the blend weight.
Returns:
Returns true if there is enough memory to add the blend weight.
LSBOOL LSE_CALL lsg::CVertexBuffer::AddColor ( LSUINT32  _ui32Index,
LSREAL  _fX,
LSREAL  _fY,
LSREAL  _fZ,
LSUINT32  _ui32Stream = 0UL 
)

Add a color at the given index. If the buffer is not large enough it will be reallocated. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the color.
_fXR color value.
_fYG color value.
_fZB color value.
_ui32StreamStream of the color value.
Returns:
Returns true if there is enough memory to add the color.
LSBOOL LSE_CALL lsg::CVertexBuffer::AddFog ( LSUINT32  _ui32Index,
LSREAL  _fX,
LSREAL  _fY,
LSREAL  _fZ,
LSUINT32  _ui32Stream = 0UL 
)

Add a fog coordinate at the given index. If the buffer is not large enough it will be reallocated. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the fog coordinate.
_fXX position of the fog coordinate.
_fYY position of the fog coordinate.
_fZZ position of the fog coordinate.
_ui32StreamStream of the fog coordinate.
Returns:
Returns true if there is enough memory to add the fog coordinate.
LSBOOL LSE_CALL lsg::CVertexBuffer::AddIndex ( LSUINT32  _ui32Index) [protected]

Ensure that the given element index is valid, allocating new elements if necessary.

Parameters:
_ui32IndexIndex to make valid.
Returns:
Returns true if there is enough memory to resize the buffer, when resizing is necessary.
LSBOOL LSE_CALL lsg::CVertexBuffer::AddNormal ( LSUINT32  _ui32Index,
LSREAL  _fX,
LSREAL  _fY,
LSREAL  _fZ,
LSUINT32  _ui32Stream = 0UL 
)

Add a normal at the given index. If the buffer is not large enough it will be reallocated. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the normal.
_fXX position of the normal.
_fYY position of the normal.
_fZZ position of the normal.
_ui32StreamStream of the normal.
Returns:
Returns true if there is enough memory to add the normal.
LSBOOL LSE_CALL lsg::CVertexBuffer::AddTangent ( LSUINT32  _ui32Index,
LSREAL  _fX,
LSREAL  _fY,
LSREAL  _fZ,
LSUINT32  _ui32Stream = 0UL 
)

Add a tangent at the given index. If the buffer is not large enough it will be reallocated. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the tangent.
_fXX position of the tangent.
_fYY position of the tangent.
_fZZ position of the tangent.
_ui32StreamStream of the tangent.
Returns:
Returns true if there is enough memory to add the tangent.
LSBOOL LSE_CALL lsg::CVertexBuffer::AddTex ( LSUINT32  _ui32Index,
LSREAL  _fU,
LSREAL  _fV,
LSUINT32  _ui32Stream = 0UL 
)

Add a texture coordinate at the given index. If the buffer is not large enough it will be reallocated. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the texture coordinate.
_fUU texture coordinate value.
_fVV texture coordinate value.
_ui32StreamStream of the coordinate value.
Returns:
Returns true if there is enough memory to add the texture coordinate.
LSBOOL LSE_CALL lsg::CVertexBuffer::AddVertex ( LSUINT32  _ui32Index,
LSREAL  _fX,
LSREAL  _fY,
LSREAL  _fZ,
LSREAL  _fW,
LSUINT32  _ui32Stream = 0UL 
)

Add a vertex at the given index. If the buffer is not large enough it will be reallocated. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the vertex.
_fXX position of the vertex.
_fYY position of the vertex.
_fZZ position of the vertex.
_fWW position of the vertex.
_ui32StreamStream of the vertex.
Returns:
Returns true if there is enough memory to add the vertex.
LSBOOL LSE_CALL lsg::CVertexBuffer::AddVertex ( LSUINT32  _ui32Index,
LSREAL  _fX,
LSREAL  _fY,
LSREAL  _fZ,
LSUINT32  _ui32Stream = 0UL 
)

Add a vertex at the given index. If the buffer is not large enough it will be reallocated. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the vertex.
_fXX position of the vertex.
_fYY position of the vertex.
_fZZ position of the vertex.
_ui32StreamStream of the vertex.
Returns:
Returns true if there is enough memory to add the vertex.
LSVOID LSE_CALL lsg::CVertexBuffer::CalculateAttributeOffsets ( ) [protected]

Determine attribute offsets.

LSVOID LSE_CALL lsg::CVertexBuffer::ChopTo ( LSUINT32  _ui32Total)

Set the total elements in the buffer. The new total must be less than or equal to the previous total. ** Must be locked.

Parameters:
_ui32TotalThe new total number of elements in the list.
static LSVOID LSE_CALL lsg::CVertexBuffer::ClearVertexArray ( ) [static, protected]

Final render. Clears all vertex buffers from the list.

static LSINT32 LSE_CCALL lsg::CVertexBuffer::ContentsSort ( LSVOID *  _pvContext,
LSUINT8 *  _pui8Left,
LSUINT8 *  _pui8Right 
) [static, protected]

Sort vertex contents inputs.

Parameters:
_pvContextUnused.
_pui8LeftLeft operand.
_pui8RightRight operand.
Returns:
Returns the lexicographical comparison between the operands.
LSBOOL LSE_CALL lsg::CVertexBuffer::CreateVertexBuffer ( const LSG_VB_CONTENTS _vcContents,
LSUINT32  _ui32UsageAndAccess = 0UL,
LSUINT32  _ui32InitialElements = 0UL,
CAllocator *  _paAllocator = NULL 
)

Create a vertex buffer.

Parameters:
_vcContentsContents of each vertex. Combine LSG_VB_CONTENTS objects to create a description of the vertex buffer's contents
_ui32UsageAndAccessUsage and access values. Combine one of the LSG_VERTEX_BUFFER_USAGE_TYPES values with one of the LSG_VERTEX_BUFFER_ACCESS_FLAGS values.
_ui32InitialElementsTotal initial elements. If custom vertex attributes are going to be used, this must be set to 0.
_paAllocatorAn optional allocator to be used for all allocations made by this instance.
Returns:
Returns false if invalid parameters are passed or if there is not enough memory to perform the initial allocation.
static LSVOID LSE_CALL lsg::CVertexBuffer::DeActivateVertexBuffer ( LSUINT32  _ui32Stream) [static]

Unapply a vertex buffer from a given stream.

Parameters:
_ui32StreamThe stream from which to remove a vertex buffer.
LSBOOL LSE_CALL lsg::CVertexBuffer::Finalize ( )

Finalize the buffer. After this point, Lock() must be called to modify the buffer. This function sends the vertex buffer data to the hardware.

Returns:
If sending the vertex buffer data to the hardware fails, this function returns false.
LSE_INLINE LSBOOL LSE_CALL lsg::CVertexBuffer::Finalized ( ) const

Gets whether or not the vertex buffer has been finalized.

Returns:
Returns true if the vertex buffer has been finalized.
LSUINT32 LSE_CALL lsg::CVertexBuffer::GetAttributesSize ( const LSG_VB_CONTENTS _vcContents) [protected]

Calculate the size of a given vertex attribute bitmask.

Parameters:
_vcContentsThe contents of which to calculate the full size.
Returns:
Returns the size of the given contents or ~0UL on error.
LSE_INLINE const LSVOID *LSE_CALL lsg::CVertexBuffer::GetElement ( LSUINT32  _ui32Index) const

Gets a pointer to an element by index. Index must be valid.

Parameters:
_ui32IndexIndex of the elemnt whose starting address is to be returned.
Returns:
Returns a void pointer to the starting address of the given element. If the vertex buffer is set-only and has been finalized, NULL is returned.
LSE_INLINE LSUINT32 LSE_CALL lsg::CVertexBuffer::GetElementSize ( ) const

Gets the size of a single element in the buffer.

Returns:
Returns the size of a single element in the buffer.
LSE_INLINE LSUINT32 LSE_CALL lsg::CVertexBuffer::GetId ( ) const

Gets the ID of this vertex buffer.

Returns:
Returns the ID of this vertex buffer.
LSE_INLINE CVector3 LSE_CALL lsg::CVertexBuffer::GetNormal ( LSUINT32  _ui32Index,
LSUINT32  _ui32Slot = 0UL 
)

Gets a 3-point normal.

Parameters:
_ui32IndexIndex of the 3-point normal to get.
_ui32SlotSlot of the 3-point normal to get.
Returns:
Returns a 3-point normal as a vector.
LSUINT32 LSE_CALL lsg::CVertexBuffer::GetSingleAttributesSize ( const LSG_VB_CONTENTS _vcContents) [protected]

Gets the size of a single attribute.

Parameters:
_vcContentsThe attribute whose size is to be obtained.
Returns:
Returns the size of the given attribute in bytes or ~0UL on error.
LSE_INLINE CVector2 LSE_CALL lsg::CVertexBuffer::GetTex2 ( LSUINT32  _ui32Index,
LSUINT32  _ui32Slot = 0UL 
)

Gets a 2-point UV coordinate.

Parameters:
_ui32IndexIndex of the 2-point UV coordinate to get.
_ui32SlotSlot of the 2-point UV coordinate to get.
Returns:
Returns a 2-point UV coordinate as a vector.
LSE_INLINE LSUINT32 LSE_CALL lsg::CVertexBuffer::GetUsage ( ) const

Gets the usage of the vertex buffer.

Returns:
Returns the usage of the vertex buffer.
LSE_INLINE CVector3 LSE_CALL lsg::CVertexBuffer::GetVertex3 ( LSUINT32  _ui32Index,
LSUINT32  _ui32Slot = 0UL 
)

Gets a 3-point vertex.

Parameters:
_ui32IndexIndex of the 3-point vertex to get.
_ui32SlotSlot of the 3-point vertex to get.
Returns:
Returns a 3-point vertex as a vector.
LSBOOL LSE_CALL lsg::CVertexBuffer::Lock ( )

Lock the buffer for reading or writing. If the buffer was made with the LSG_VBUT_SETONLY flag, this function fails. If the function returns true, this must be paired with a call to UnLock().

Returns:
Returns true if the buffer was not created with the LSG_VBUT_SETONLY flag.
LSE_INLINE LSVOID LSE_CALL lsg::CVertexBuffer::MoveElement ( LSUINT32  _ui32Index,
LSUINT32  _ui32DestIndex 
)

Move an elemnt from one index to another.

Parameters:
_ui32SrcIndexIndex of the element to move.
_ui32DestIndexIndex where to move the element.
CVertexBuffer& LSE_CALL lsg::CVertexBuffer::operator= ( const CVertexBuffer _vbOther)

Copy operator.

Parameters:
_vbOtherThe object to copy.
Returns:
Returns this object after the copy.
LSVOID LSE_CALL lsg::CVertexBuffer::Reset ( )

Reset everything to scratch.

Reimplemented from lsg::CVertexBufferBase.

LSVOID LSE_CALL lsg::CVertexBuffer::SetAllocator ( CAllocator *  _paAllocator)

Set the allocator to be used by this vertex buffer. Causes the vertex buffer to be reset unless the new allocator is the same as the old one.

Parameters:
_paAllocatorThe allocator to set.
LSE_INLINE LSVOID LSE_CALL lsg::CVertexBuffer::SetAlpha ( LSUINT32  _ui32Index,
LSREAL  _fA,
LSUINT32  _ui32Stream = 0UL 
)

Set the alpha alpha value value at the given index. The buffer must be large enough. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the alpha value.
_fAAlpha value.
_ui32StreamStream of the alpha value.
LSE_INLINE LSVOID LSE_CALL lsg::CVertexBuffer::SetBiNormal ( LSUINT32  _ui32Index,
LSREAL  _fX,
LSREAL  _fY,
LSREAL  _fZ,
LSUINT32  _ui32Stream = 0UL 
)

Set a bi-normal at the given index. The buffer must be large enough. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the bi-normal.
_fXX position of the bi-normal.
_fYY position of the bi-normal.
_fZZ position of the bi-normal.
_ui32StreamStream of the bi-normal.
LSE_INLINE LSVOID LSE_CALL lsg::CVertexBuffer::SetBlendWeight ( LSUINT32  _ui32Index,
LSREAL  _f0,
LSREAL  _f1,
LSREAL  _f2,
LSREAL  _f3,
LSUINT32  _ui32Stream = 0UL 
)

Set a blend weight at the given index. The buffer must be large enough. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the blend weight.
_f0Blend weight 0.
_f1Blend weight 1.
_f2Blend weight 2.
_f3Blend weight 3.
_ui32StreamStream of the blend weight.
LSE_INLINE LSVOID LSE_CALL lsg::CVertexBuffer::SetColor ( LSUINT32  _ui32Index,
LSREAL  _fX,
LSREAL  _fY,
LSREAL  _fZ,
LSUINT32  _ui32Stream = 0UL 
)

Set a color at the given index. The buffer must be large enough. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the color.
_fXR color value.
_fYG color value.
_fZB color value.
_ui32StreamStream of the color value.
LSE_INLINE LSVOID LSE_CALL lsg::CVertexBuffer::SetFog ( LSUINT32  _ui32Index,
LSREAL  _fX,
LSREAL  _fY,
LSREAL  _fZ,
LSUINT32  _ui32Stream = 0UL 
)

Set a fog coordinate at the given index. The buffer must be large enough. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the fog coordinate.
_fXX position of the fog coordinate.
_fYY position of the fog coordinate.
_fZZ position of the fog coordinate.
_ui32StreamStream of the fog coordinate.
LSE_INLINE LSVOID LSE_CALL lsg::CVertexBuffer::SetNormal ( LSUINT32  _ui32Index,
LSREAL  _fX,
LSREAL  _fY,
LSREAL  _fZ,
LSUINT32  _ui32Stream = 0UL 
)

Set a normal at the given index. The buffer must be large enough. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the normal.
_fXX position of the normal.
_fYY position of the normal.
_fZZ position of the normal.
_ui32StreamStream of the normal.
LSE_INLINE LSVOID LSE_CALL lsg::CVertexBuffer::SetTangent ( LSUINT32  _ui32Index,
LSREAL  _fX,
LSREAL  _fY,
LSREAL  _fZ,
LSUINT32  _ui32Stream = 0UL 
)

Set a tangent at the given index. The buffer must be large enough. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the tangent.
_fXX position of the tangent.
_fYY position of the tangent.
_fZZ position of the tangent.
_ui32StreamStream of the tangent.
LSE_INLINE LSVOID LSE_CALL lsg::CVertexBuffer::SetTex ( LSUINT32  _ui32Index,
LSREAL  _fU,
LSREAL  _fV,
LSUINT32  _ui32Stream = 0UL 
)

Set a texture coordinate at the given index. The buffer must be large enough. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the texture coordinate.
_fUU texture coordinate value.
_fVV texture coordinate value.
_ui32StreamStream of the coordinate value.
LSE_INLINE LSVOID LSE_CALL lsg::CVertexBuffer::SetVertex ( LSUINT32  _ui32Index,
LSREAL  _fX,
LSREAL  _fY,
LSREAL  _fZ,
LSUINT32  _ui32Stream = 0UL 
)

Set a vertex at the given index. The buffer must be large enough. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the vertex.
_fXX position of the vertex.
_fYY position of the vertex.
_fZZ position of the vertex.
_ui32StreamStream of the vertex.
LSE_INLINE LSVOID LSE_CALL lsg::CVertexBuffer::SetVertex ( LSUINT32  _ui32Index,
LSREAL  _fX,
LSREAL  _fY,
LSREAL  _fZ,
LSREAL  _fW,
LSUINT32  _ui32Stream = 0UL 
)

Set a vertex at the given index. The buffer must be large enough. ** Must be locked.

Parameters:
_ui32IndexIndex where to add the vertex.
_fXX position of the vertex.
_fYY position of the vertex.
_fZZ position of the vertex.
_fWW position of the vertex.
_ui32StreamStream of the vertex.
LSVOID LSE_CALL lsg::CVertexBuffer::SortContents ( ) [protected]

Sort our contents list in place.

LSE_INLINE LSUINT32 LSE_CALL lsg::CVertexBuffer::Stride ( ) const

Gets the stride of the vertex buffer.

Returns:
Returns the stride of the vertex buffer.
LSE_INLINE LSUINT32 LSE_CALL lsg::CVertexBuffer::TotalElements ( ) const

Gets the number of elements held in the vertex buffer.

Returns:
Returns the number of elements held in the vertex buffer.
LSE_INLINE LSUINT32 LSE_CALL lsg::CVertexBuffer::TotalPrimitives ( ) const

Gets the number of primitives held in the vertex buffer.

Returns:
Returns the number of primitives held in the vertex buffer.
LSBOOL LSE_CALL lsg::CVertexBuffer::TransferElement ( CVertexBuffer _vbTarget,
LSG_VERTEX_ATTRIBUTES  _vaElementType,
LSUINT32  _ui32Slot 
)

Gives all of a type of element to another vertex buffer and removes the given element from this vertex buffer. For example, this can be used to transfer all of the normals from this vertex buffer to another. ** Must be locked.

Parameters:
_vbTargetThe vertex buffer to which to transfer the given element.
_vaElementTypeThe type of element to tansfer.
_ui32SlotThe slot of the element to transfer.
Returns:
Returns true if there is enough memory to fullfill the operation.
LSVOID LSE_CALL lsg::CVertexBuffer::UnLock ( )

Unlock the buffer when done modifying it. Must be called once per successful Lock() call.


Member Data Documentation

CVertexBuffer* lsg::CVertexBuffer::m_pvbVertexBuffers[LSG_VBM_MAX_STREAMS] [static, protected]

Streams of vertex buffers.

LSUINT32 lsg::CVertexBuffer::m_ui32HighestVertexBuffer [static, protected]

The highest vertex buffer set.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator