MVertexBufferDescriptor Class Reference


Detailed Description

Describes properties of a vertex buffer.

This class gives a complete description of a vertex buffer and is used by MGeometry, MVertexBuffer and MGeometryRequirements to simplify management of vertex buffer attributes.

Note that not all combinations of semantics, data types and dimensions are currently supported. Attempts to create vertex buffers with unsupported attributes will fail.

Examples:

cgfxShaderNode.cpp, hwColorPerVertexShader.cpp, and hwPhongShader.cpp.

#include <MHWGeometry.h>

List of all members.

Public Member Functions

  MVertexBufferDescriptor ()
  Constructor.
  MVertexBufferDescriptor (const MString &name, MGeometry::Semantic semantic, MGeometry::DataType dataType, int dimension)
  Constructor.
  ~MVertexBufferDescriptor ()
  Destructor.
  MVertexBufferDescriptor (const MVertexBufferDescriptor &other)
  NO SCRIPT SUPPORT.
MVertexBufferDescriptor operator= (const MVertexBufferDescriptor &other)
  NO SCRIPT SUPPORT.
MString  name () const
  Get the name of the buffer.
void  setName (const MString &n)
  Set the name of the buffer.
MGeometry::Semantic  semantic () const
  Get the semantic of the buffer.
void  setSemantic (MGeometry::Semantic s)
  Set the semantic of the buffer.
MGeometry::DataType  dataType () const
  Get the data type of the buffer.
void  setDataType (MGeometry::DataType d)
  Set the semantic of the buffer.
unsigned int  dataTypeSize () const
  Get the size in bytes of the data type of the buffer.
int  dimension () const
  Get the dimension of the buffer.
void  setDimension (int d)
  Set the dimension of the buffer.
int  offset () const
  Get the offset of the vertex buffer.
int  stride () const
  Get the stride of the vertex buffer.

Static Public Member Functions

static const char *  className ()
  Returns the name of this class.

Constructor & Destructor Documentation

MVertexBufferDescriptor ( const MString name,
MGeometry::Semantic  semantic,
MGeometry::DataType  type,
int  dimension 
)

Constructor.

Parameters:
[in] name The name of the buffer
[in] semantic The semantic of the buffer
[in] type The data type of the buffer
[in] dimension The dimension of the data type

NO SCRIPT SUPPORT.

Copy constructor.

Parameters:
[in] other The descriptor to copy

Member Function Documentation

MVertexBufferDescriptor & operator= ( const MVertexBufferDescriptor other )

NO SCRIPT SUPPORT.

Assignment operator.

Parameters:
[in] other The descriptor to copy
Returns:
Reference to this
MString name ( ) const

Get the name of the buffer.

Returns:
The name of the buffer
Examples:
cgfxShaderNode.cpp, and hwPhongShader.cpp.
void setName ( const MString n )

Set the name of the buffer.

Parameters:
[in] n The new name
MGeometry::Semantic semantic ( ) const

Get the semantic of the buffer.

Returns:
The semantic of the buffer
Examples:
cgfxShaderNode.cpp, hwColorPerVertexShader.cpp, and hwPhongShader.cpp.
void setSemantic ( MGeometry::Semantic  s )

Set the semantic of the buffer.

Parameters:
[in] s The new semantic
MGeometry::DataType dataType ( ) const

Get the data type of the buffer.

Returns:
The data type of the buffer
Examples:
hwPhongShader.cpp.
void setDataType ( MGeometry::DataType  d )

Set the semantic of the buffer.

Parameters:
[in] d The new semantic
unsigned int dataTypeSize ( ) const

Get the size in bytes of the data type of the buffer.

Returns:
the size in bytes of the data type of the buffer
Examples:
cgfxShaderNode.cpp.
int dimension ( ) const

Get the dimension of the buffer.

Returns:
The dimension of the buffer
Examples:
cgfxShaderNode.cpp, and hwPhongShader.cpp.
void setDimension ( int  d )

Set the dimension of the buffer.

Parameters:
[in] d The new dimension
int offset ( ) const

Get the offset of the vertex buffer.

Note user-setting of this value is not currently supported. The value returned by this method is currently only valid in the context of MPxShaderOverride::draw().

Returns:
The offset of the vertex buffer.
Examples:
cgfxShaderNode.cpp, hwColorPerVertexShader.cpp, and hwPhongShader.cpp.
int stride ( ) const

Get the stride of the vertex buffer.

Note user-setting of this value is not currently supported. The value returned by this method is currently only valid in the context of MPxShaderOverride::draw().

Returns:
The stride of the vertex buffer.
Examples:
cgfxShaderNode.cpp, hwColorPerVertexShader.cpp, and hwPhongShader.cpp.
const char * className ( ) [static]

Returns the name of this class.

Returns:
The name of this class.

MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor
MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor MVertexBufferDescriptor