XFcGLTriangleInfoBuffer class Reference

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

# XFcGLTriangleInfoBuffer Class Reference

Triangle info buffer object. More...

List of all members.

## Public Member Functions

XFCIMPORT | ~XFcGLTriangleInfoBuffer ()
| Destructor.
XFCIMPORT void * | lock ()
| Locks the triangle info buffer.
XFCIMPORT void | unlock ()
| Unlocks the triangle info buffer.

## Static Public Member Functions

XFCIMPORT XFcGLTriangleInfoBuffer * | create (UINT32 aTriangleFlags, INT aSizeOfTriangle, INT aNumberOfTriangles)
| Creates an XFcGLTriangleInfoBuffer.

## Public Attributes

INT | mInfoSize
| Size of one triangle info unit in bytes.
INT | mNumTriangles
| Number of triangles specified (from construction).
UINT32 | mInfoFlags
| Flags (from construction).
INT | mDiffuseColorOffs
| Diffuse color offset (-1 if not specified).
INT | mNormalOffs
| Normal offset (-1 if not specified).
INT | mTexture1Offs
| Texture1 cordinate offset (-1 if not specified).

## Protected Member Functions

void | initOffsets (UINT32 aTriangleFlags)
| Calculates the offsets into the data buffer.

## Protected Attributes

UINT8 * | mTriangleInfoData
| The actual data.

## Friends

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

## Detailed Description

Triangle info buffer object.

Triangle info buffers are used to optimize meshes so that duplicate vertices are not needed where, for example, each triangle has its own texture coordinates.

     // An example of legal triangleinfo data:
     #define XFCGLTRIANGLEINFO (XFCGLTR_DIFFUSECOLOR | XFCGLTR_NORMAL | XFCGLTR_TEXTURE1)

     // The data in the buffer must be in a specific order:
     // - Diffuse color
     // - Normal vector
     // - Texture coordinates

     class XFcGLTriangleInfo
     {
     public:
         UINT32 mDiffuseColor;
         REAL mNX, mNY, mNZ;
         REAL mU[3], mV[3];
     };

See also:
  XFcGLTriangleInfo

## Constructor & Destructor Documentation

XFCIMPORT XFcGLTriangleInfoBuffer::~XFcGLTriangleInfoBuffer | ( |  | ) |

| Destructor.

## Member Function Documentation

XFCIMPORT XFcGLTriangleInfoBuffer* XFcGLTriangleInfoBuffer::create | ( | UINT32 | aTriangleFlags,
|  | INT | aSizeOfTriangle,
|  | INT | aNumberOfTriangles
| ) | `[static]`

Creates an XFcGLTriangleInfoBuffer.

Parameters:

  aTriangleFlags | flags describing the triangle info buffer, see XFCGLTRIANGLEFLAGS.
  aSizeOfTriangle | size of one triangle information in bytes.
  aNumberOfTriangles | number of triangles in the buffer.

Returns:
  new triangle info buffer object, or NULL if unsuccessful.

See also:
  XFCGLTRIANGLEFLAGS

void XFcGLTriangleInfoBuffer::initOffsets | ( | UINT32 | aTriangleFlags | ) | `[protected]`

| Calculates the offsets into the data buffer.

XFCIMPORT void* XFcGLTriangleInfoBuffer::lock | ( |  | ) |

Locks the triangle info buffer.

Returns:
  pointer to the triangle info data.

XFCIMPORT void XFcGLTriangleInfoBuffer::unlock | ( |  | ) |

| Unlocks the triangle info buffer.

## 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 XFcGLTriangleInfoBuffer::mDiffuseColorOffs

| Diffuse color offset (-1 if not specified).

UINT32 XFcGLTriangleInfoBuffer::mInfoFlags

| Flags (from construction).

INT XFcGLTriangleInfoBuffer::mInfoSize

| Size of one triangle info unit in bytes.

INT XFcGLTriangleInfoBuffer::mNormalOffs

| Normal offset (-1 if not specified).

INT XFcGLTriangleInfoBuffer::mNumTriangles

| Number of triangles specified (from construction).

INT XFcGLTriangleInfoBuffer::mTexture1Offs

| Texture1 cordinate offset (-1 if not specified).

UINT8* XFcGLTriangleInfoBuffer::mTriangleInfoData`[protected]`

| The actual data.

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