Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# XFcGLVertexBuffer Class Reference

Vertex buffer. More...

Collaboration diagram for XFcGLVertexBuffer:

[legend]
List of all members.

## Public Member Functions
virtual XFCIMPORT | ~XFcGLVertexBuffer ()
| Virtual destructor.
XFCIMPORT INT32 | getFlags ()
| Returns creation flags.
XFCIMPORT INT32 | getVertexStride ()
| Returns how many bytes each vertex takes in the buffer.
XFCIMPORT INT32 | getNumVertices ()
| Returns the vertex count.
XFCIMPORT void * | lock (INT32 aLockFlags)
| Locks vertex buffer.
XFCIMPORT INT32 | unlock ()
| Unlocks the vertex buffer. Buffer must be unlocked in order to be used.
XFCIMPORT INT32 | optimize ()
| Optimizes a vertex buffer.
## Static Public Member Functions
XFCIMPORT XFcGLVertexBuffer * | create (INT32 aVertexFlags, INT32 aSizeOfVertex, INT32 aNumberOfVertices)
| Creates a XFcGLVertexBuffer object.
## Protected Member Functions
| XFcGLVertexBuffer ()
| Protected constructor.
void | initVariables ()
| Initializes all variables to default values.
INT32 | initOffsets (INT32 aVertexFlags)
| Initializes all offsets.
INT | isValid ()
| Returns non-zero if the vertex buffer is valid.
INT32 | createProcessedBufferFlags (INT32 aSrcVertexFlags)
| Returns flags suitable for processed vertices on buffer with given flags.
## Protected Attributes
INT32 | mVertexFlags
| Vertex flags (from construction).
INT32 | mVertexStride
| Size of one vertex.
INT32 | mNumberOfVertices
| Number of vertices in buffer.
void * | mVertexData
| Pointer to vertex data.
INT32 | mStateCount
| Matrix state/lock counter that was used to calculate the following.
XFcVector3 * | mPosition
UINT32 * | mDiffuseColor
REAL * | mUV
XFcVector3 * | mNormal
INT | mIsOptimized
| Non-zero if this vertex buffer is optimized.
INT | mRHWOffs
| Offset to RHW component, or 0 if not supported by format.
INT | mNormalOffs
| Offset to the normal, or 0 if not supported by format.
INT | mDiffuseColorOffs
| Offset to the diffuse color, or 0 if not supported by format.
INT | mSpecularColorOffs
| Offset to the specular color, or 0 if not supported by format.
INT | mTexture1Offs
| Offset to texture 1 coordinates, or 0 if not supported by format.
INT | mTexture2Offs
| Offset to texture 2 coordinates, or 0 if not supported by format.
INT | mTexture3Offs
| Offset to texture 3 coordinates, or 0 if not supported by format.
INT | mTexture4Offs
| Offset to texture 4 coordinates, or 0 if not supported by format.
INT | mClipInfoOffs
| Offset to clip info, or 0 if not supported by format.
## Friends
class | XFcGLCore
| XFcGLCore needs access to offsets (and is the only class that needs it).

## Detailed Description

Vertex buffer.

This is a wrapper for an array of vertices. The vertex format itself is flexible - see XFcGLVertex, XFcGLLVertex and XFcGLTLVertex as examples of legal vertex formats.

See also:
  XFcGLVertex

  XFcGLLVertex

  XFcGLTLVertex

## Constructor & Destructor Documentation

virtual XFCIMPORT XFcGLVertexBuffer::~XFcGLVertexBuffer | ( |  | ) | `[virtual]`

| Virtual destructor.

XFcGLVertexBuffer::XFcGLVertexBuffer | ( |  | ) | `[protected]`

| Protected constructor.

## Member Function Documentation

XFCIMPORT XFcGLVertexBuffer* XFcGLVertexBuffer::create | ( | INT32 | aVertexFlags,
|  | INT32 | aSizeOfVertex,
|  | INT32 | aNumberOfVertices
| ) | `[static]`

  | Creates a XFcGLVertexBuffer object. Parameters:
  aVertexFlags | vertex flags, see XFCGLVERTEXFLAGS.
  aSizeOfVertex | size of one vertex structure, in bytes.
  aNumberOfVertices | number of vertices to allocate.
Returns: new vertex buffer, or NULL if unsuccessful. See also: XFcGLVertex, XFcGLLVertex, XFcGLTLVertex

INT32 XFcGLVertexBuffer::createProcessedBufferFlags | ( | INT32 | aSrcVertexFlags | ) | `[protected]`

| Returns flags suitable for processed vertices on buffer with given flags.

XFCIMPORT INT32 XFcGLVertexBuffer::getFlags | ( |  | ) |

| Returns creation flags.

XFCIMPORT INT32 XFcGLVertexBuffer::getNumVertices | ( |  | ) |

| Returns the vertex count.

XFCIMPORT INT32 XFcGLVertexBuffer::getVertexStride | ( |  | ) |

| Returns how many bytes each vertex takes in the buffer.

INT32 XFcGLVertexBuffer::initOffsets | ( | INT32 | aVertexFlags | ) | `[protected]`

  | Initializes all offsets. Parameters:
  aVertexFlags | vertex buffer flags, see XFCGLVERTEXFLAGS.

void XFcGLVertexBuffer::initVariables | ( |  | ) | `[protected]`

| Initializes all variables to default values.

INT XFcGLVertexBuffer::isValid | ( |  | ) | `[protected]`

| Returns non-zero if the vertex buffer is valid.

XFCIMPORT void* XFcGLVertexBuffer::lock | ( | INT32 | aLockFlags | ) |

  | Locks vertex buffer. Parameters:
  aLockFlags | vertex buffer locking flags, see XFCGLVBLOCKFLAGS.
Returns: pointer to the vertex buffer data, or NULL if buffer cannot be locked. See also: XFCGLVBLOCKFLAGS optimize

XFCIMPORT INT32 XFcGLVertexBuffer::optimize | ( |  | ) |

| Optimizes a vertex buffer. Note: After optimization the vertex buffer can not be locked.

XFCIMPORT INT32 XFcGLVertexBuffer::unlock | ( |  | ) |

| Unlocks the vertex buffer. Buffer must be unlocked in order to be used.

## Friends And Related Function Documentation

friend class XFcGLCore`[friend]`

| XFcGLCore needs access to offsets (and is the only class that needs it).

## Member Data Documentation

INT XFcGLVertexBuffer::mClipInfoOffs`[protected]`

| Offset to clip info, or 0 if not supported by format.

UINT32* XFcGLVertexBuffer::mDiffuseColor`[protected]`

INT XFcGLVertexBuffer::mDiffuseColorOffs`[protected]`

| Offset to the diffuse color, or 0 if not supported by format.

INT XFcGLVertexBuffer::mIsOptimized`[protected]`

| Non-zero if this vertex buffer is optimized.

XFcVector3* XFcGLVertexBuffer::mNormal`[protected]`

INT XFcGLVertexBuffer::mNormalOffs`[protected]`

| Offset to the normal, or 0 if not supported by format.

INT32 XFcGLVertexBuffer::mNumberOfVertices`[protected]`

| Number of vertices in buffer.

XFcVector3* XFcGLVertexBuffer::mPosition`[protected]`

INT XFcGLVertexBuffer::mRHWOffs`[protected]`

| Offset to RHW component, or 0 if not supported by format.

INT XFcGLVertexBuffer::mSpecularColorOffs`[protected]`

| Offset to the specular color, or 0 if not supported by format.

INT32 XFcGLVertexBuffer::mStateCount`[protected]`

| Matrix state/lock counter that was used to calculate the following.

INT XFcGLVertexBuffer::mTexture1Offs`[protected]`

| Offset to texture 1 coordinates, or 0 if not supported by format.

INT XFcGLVertexBuffer::mTexture2Offs`[protected]`

| Offset to texture 2 coordinates, or 0 if not supported by format.

INT XFcGLVertexBuffer::mTexture3Offs`[protected]`

| Offset to texture 3 coordinates, or 0 if not supported by format.

INT XFcGLVertexBuffer::mTexture4Offs`[protected]`

| Offset to texture 4 coordinates, or 0 if not supported by format.

REAL* XFcGLVertexBuffer::mUV`[protected]`

void* XFcGLVertexBuffer::mVertexData`[protected]`

| Pointer to vertex data.

INT32 XFcGLVertexBuffer::mVertexFlags`[protected]`

| Vertex flags (from construction).

INT32 XFcGLVertexBuffer::mVertexStride`[protected]`

| Size of one vertex.

|  | X-Forge Documentation Confidential Copyright © 2002-2003 Fathammer |  | Documentation generated with doxygen by Dimitri van Heesch