Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | Namespace Members | Class Members | Related Pages

VertexBufferStreamMapping Class Reference
[XEngineCore Library]

List of all members.

Detailed Description

This small data class defines the vertex buffer stream mapping used in the RenderContext::Draw methods. It defines which vertex buffers get mapped to which vertex buffer streams. The format of the vertex buffers used in each stream must conform to the vertex formats specified in the VertexAttribBinding object associated with the currently active ShaderProgram.

Warning:
Only buffers that were created by the same render context can be added to a stream mapping.


Public Member Functions

 VertexBufferStreamMapping ()
 Constructor that creates an empty stream mapping.
 VertexBufferStreamMapping (const boost::shared_ptr< VertexBuffer > &pVertexBuffer)
 Constructor that maps stream 0 to the given vertex buffer.
 VertexBufferStreamMapping (const boost::shared_ptr< VertexBuffer > &pVertexBuffer0, const boost::shared_ptr< VertexBuffer > &pVertexBuffer1)
 Constructor that maps streams 0 and 1 to the given vertex buffers.
void AddStream (size_t streamIndex, const boost::shared_ptr< VertexBuffer > &pVertexBuffer)
 Adds a stream mapping for the given stream to the given vertex buffer.
void SetStream (size_t streamIndex, const boost::shared_ptr< VertexBuffer > &pVertexBuffer)
 Sets the stream mapping for the given stream to the given vertex buffer.
size_t GetStreamCount () const
 Returns the number of streams used in this mapping.
bool UsesStream (size_t streamIndex) const
 Returns true if the given stream is used in this mapping.
const boost::shared_ptr< VertexBuffer > & GetVertexBuffer (size_t streamIndex=0) const
 Returns the vertex buffer mapped to the given stream in this mapping.
const VertexFormatGetVertexFormat (size_t streamIndex=0) const
 Returns the vertex format of the vertex buffer mapped to the given stream in this mapping.
const Mapping & GetMapping () const
 Returns the entire vertex buffer stream mapping.
size_t GetMinVertexCount () const
 Returns the minimum number of vertices of the vertex buffers in this mapping.
size_t GetMaxVertexCount () const
 Returns the maximum number of vertices of the vertex buffers in this mapping.
bool IsCompatibleBinding (const VertexAttribBinding &binding) const
 Returns true, if this vertex buffer stream mapping is compatible with the given vertex attribute binding.
boost::shared_ptr< RenderContextGetRenderContext () const
 Returns the render context used by the vertex buffers of this stream mapping.


Constructor & Destructor Documentation

VertexBufferStreamMapping  ) 
 

Constructor that creates an empty stream mapping.

VertexBufferStreamMapping const boost::shared_ptr< VertexBuffer > &  pVertexBuffer  ) 
 

Constructor that maps stream 0 to the given vertex buffer.

VertexBufferStreamMapping const boost::shared_ptr< VertexBuffer > &  pVertexBuffer0,
const boost::shared_ptr< VertexBuffer > &  pVertexBuffer1
 

Constructor that maps streams 0 and 1 to the given vertex buffers.


Member Function Documentation

void AddStream size_t  streamIndex,
const boost::shared_ptr< VertexBuffer > &  pVertexBuffer
 

Adds a stream mapping for the given stream to the given vertex buffer.

const VertexBufferStreamMapping::Mapping & GetMapping  )  const
 

Returns the entire vertex buffer stream mapping.

size_t GetMaxVertexCount  )  const
 

Returns the maximum number of vertices of the vertex buffers in this mapping. For example, for a mapping with a vertex buffer with 5 elements in stream 0 and a vertex buffer with 7 elements in stream 1, this method would return 7.

size_t GetMinVertexCount  )  const
 

Returns the minimum number of vertices of the vertex buffers in this mapping. For example, for a mapping with a vertex buffer with 5 elements in stream 0 and a vertex buffer with 7 elements in stream 1, this method would return 5.

boost::shared_ptr< RenderContext > GetRenderContext  )  const
 

Returns the render context used by the vertex buffers of this stream mapping. If this mapping is not yet filled with any data, returns an empty shared pointer.

size_t GetStreamCount  )  const
 

Returns the number of streams used in this mapping.

const boost::shared_ptr< VertexBuffer > & GetVertexBuffer size_t  streamIndex = 0  )  const
 

Returns the vertex buffer mapped to the given stream in this mapping.

const VertexFormat & GetVertexFormat size_t  streamIndex = 0  )  const
 

Returns the vertex format of the vertex buffer mapped to the given stream in this mapping.

bool IsCompatibleBinding const VertexAttribBinding binding  )  const
 

Returns true, if this vertex buffer stream mapping is compatible with the given vertex attribute binding. A vertex buffer stream mapping is compatible with a vertex attribute binding, if it contains a mapping for each vertex buffer stream used in the binding and if the mapped-to vertex buffers have the same vertex format as specified in the binding.

void SetStream size_t  streamIndex,
const boost::shared_ptr< VertexBuffer > &  pVertexBuffer
 

Sets the stream mapping for the given stream to the given vertex buffer.

bool UsesStream size_t  streamIndex  )  const
 

Returns true if the given stream is used in this mapping.


The documentation for this class was generated from the following files: