D3D9::VertexArray< _vertex_data_t, _vertex_caps > Class Template Reference

VertexArray can be thought as improved version of D3D9::VertexBuffer, with vertex format fixed at compile time, with more strict compile-time type checking. More...

#include <dx9_wrap.h>

Collaboration diagram for D3D9::VertexArray< _vertex_data_t, _vertex_caps >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 VertexArray (Device &n_device, int vertex_count)
 Create D3D9::VertexArray instance.

int get_capacity () const
 Return capacity of the array (count of elements it can hold).

int get_vertex_size () const
 Retrieve size (in bytes) of single vertex instance stored in the array.

int get_vertex_caps () const
 Retrieve vertex "caps" flags.

void select (int stream_index=0)
 Select this VertexArray as active for device input stream "stream_index" on attached render device.


Detailed Description

template<typename _vertex_data_t, DWORD _vertex_caps = 0>
class D3D9::VertexArray< _vertex_data_t, _vertex_caps >

VertexArray can be thought as improved version of D3D9::VertexBuffer, with vertex format fixed at compile time, with more strict compile-time type checking.

Note:
D3D9::VertexArray is adapter on top of D3D9::VertexBuffer, providing more type-safe and intuitive interface than D3D9::VertexBuffer,
This adapter is to be used when type of vertex elements in vertex buffer is known
at compile time and is not going to change during program run-time. This is often the case with simple applications, technology demos, and various tools.
If you need to dynamically decide the type of vertex data at runtime - you'll need
to use D3D9::VertexBuffer instead.
Note that using D3D9::VertexBuffer can be clumsy and will require usage of C++ type
casting, which is usually not a good practice, hence, use this class unless you absolutely need to dynamically, at runtime, decide the format of vertex buffer elements.


Constructor & Destructor Documentation

template<typename _vertex_data_t, DWORD _vertex_caps = 0>
D3D9::VertexArray< _vertex_data_t, _vertex_caps >::VertexArray Device n_device,
int  vertex_count
[inline]
 

Create D3D9::VertexArray instance.

Type of individual elements is fixed at runtime, so you only need to specify count of vertices to allocate the memory for.


Member Function Documentation

template<typename _vertex_data_t, DWORD _vertex_caps = 0>
int D3D9::VertexArray< _vertex_data_t, _vertex_caps >::get_capacity  )  const [inline]
 

Return capacity of the array (count of elements it can hold).

template<typename _vertex_data_t, DWORD _vertex_caps = 0>
int D3D9::VertexArray< _vertex_data_t, _vertex_caps >::get_vertex_size  )  const [inline]
 

Retrieve size (in bytes) of single vertex instance stored in the array.

Note:
In VertexArray implementation is even faster than in VertexBuffer ;o)

template<typename _vertex_data_t, DWORD _vertex_caps = 0>
int D3D9::VertexArray< _vertex_data_t, _vertex_caps >::get_vertex_caps  )  const [inline]
 

Retrieve vertex "caps" flags.

This is usually 0, but can be value of legacy "FVF" bit mask (see Direct3D v9 documentation).

Note:
In VertexArray implementation is even faster than in VertexBuffer ;o)

template<typename _vertex_data_t, DWORD _vertex_caps = 0>
void D3D9::VertexArray< _vertex_data_t, _vertex_caps >::select int  stream_index = 0  )  [inline]
 

Select this VertexArray as active for device input stream "stream_index" on attached render device.

Default stream index (when not specified) is 0.


The documentation for this class was generated from the following file:
Generated on Sun May 1 17:34:23 2005 for RealityStrike Game Engine API by doxygen 1.3.6