IndexBufferHandle Class Reference
 
 
 
IndexBufferHandle Class Reference

This reference page is linked to from the following overview topics: Low-level Device API.


#include <IndexBufferHandle.h>

Inheritance diagram for IndexBufferHandle:
SmartHandle Noncopyable MaxHeapOperators

Class Description

IndexBufferHandle is a memory buffer that contain index data.

Index data, or indices, are integer offsets into vertex buffers and are used to render primitives.

Public Member Functions

GraphicsDriverAPI  IndexBufferHandle ()
GraphicsDriverAPI  IndexBufferHandle (const IndexBufferHandle &from)
GraphicsDriverAPI
IndexBufferHandle
operator= (const IndexBufferHandle &from)
virtual GraphicsDriverAPI  ~IndexBufferHandle ()
GraphicsDriverAPI bool  Initialize (IndexType type)
  Initialize the index buffer.
GraphicsDriverAPI IndexType  GetType () const
  Get the type of the index buffer.
GraphicsDriverAPI size_t  GetNumberOfIndices () const
  Get the number of indices of this buffer.
GraphicsDriverAPI void  SetNumberOfIndices (size_t numberOfIndices)
  Set the number of indices of this buffer.
GraphicsDriverAPI unsigned char *  Lock (size_t index, size_t numberOfIndices, AccessType accessType)
  This function is used for reading/writing data from/into the index buffer.
GraphicsDriverAPI void  Unlock ()
  Unlock the buffer to update.

Constructor & Destructor Documentation

GraphicsDriverAPI IndexBufferHandle ( )
GraphicsDriverAPI IndexBufferHandle ( const IndexBufferHandle from )
virtual GraphicsDriverAPI ~IndexBufferHandle ( ) [virtual]

Member Function Documentation

GraphicsDriverAPI IndexBufferHandle& operator= ( const IndexBufferHandle from )
GraphicsDriverAPI bool Initialize ( IndexType  type )

Initialize the index buffer.

Parameters:
type The type of the newly created buffer.
Returns:
true if successfully initialized, false otherwise.
GraphicsDriverAPI IndexType GetType ( ) const

Get the type of the index buffer.

Returns:
The type of the index buffer as an IndexType
GraphicsDriverAPI size_t GetNumberOfIndices ( ) const

Get the number of indices of this buffer.

Returns:
The number of indices
GraphicsDriverAPI void SetNumberOfIndices ( size_t  numberOfIndices )

Set the number of indices of this buffer.

Parameters:
numberOfIndices The size of the buffer
GraphicsDriverAPI unsigned char* Lock ( size_t  index,
size_t  numberOfIndices,
AccessType  accessType 
)

This function is used for reading/writing data from/into the index buffer.

Parameters:
index the start index that the lock operation starts
numberOfIndices the number of indices that this function will lock.
accessType indicate how to operate on the buffer.
Returns:
the buffer for developers to read/write index data. The size of the buffer is numberOfIndices * indexStride.
GraphicsDriverAPI void Unlock ( )

Unlock the buffer to update.

This function must be called after Lock. Once this function is called, the buffer that returned by Lock become invalid and should not be used any more.