Main Page   Class Hierarchy   Compound List   File List   Compound Members  

iPolygonBuffer Struct Reference

This interface represents a black-box polygon buffer. More...

#include <vbufmgr.h>

Inheritance diagram for iPolygonBuffer:

iBase List of all members.

Public Methods

virtual void AddPolygon (int *verts, int num_verts, const csPlane3 &poly_normal, int mat_index, const csMatrix3 &m_obj2tex, const csVector3 &v_obj2tex, iPolygonTexture *poly_texture)=0
 Add a polygon to this buffer. More...

virtual void SetVertexArray (csVector3 *verts, int num_verts)=0
 Set vertices to use for the polygons. More...

virtual void AddMaterial (iMaterialHandle *mat_handle)=0
 Add a material.

virtual int GetMaterialCount () const=0
 Get the number of materials.

virtual iMaterialHandleGetMaterial (int idx) const=0
 Get a material.

virtual int GetVertexCount () const=0
 Gets the numebr of vertices.

virtual csVector3GetVertices () const=0
 Gets the array of vertices.

virtual void SetMaterial (int idx, iMaterialHandle *mat_handle)=0
 Set a previously added material (this can be used to change a material handle).

virtual void Clear ()=0
 Clear all polygons, materials, and vertex array.

Detailed Description

This interface represents a black-box polygon buffer.

It is used to draw a mesh of polygons. The vertex buffer manager will create instances of iPolygonBuffer. Internally it will hold the most efficient representation for the 3D renderer to actually render the polygons. On hardware this may means that the polygons are converted to triangle meshes or triangle fans/strips. With the software renderer it will probably keep the polygons as such. Polygons in this buffer used indexed coordinates (with indices that are usually relative to a vertex buffer).

Member Function Documentation

void iPolygonBuffer::AddPolygon ( int * verts,
int num_verts,
const csPlane3 & poly_normal,
int mat_index,
const csMatrix3 & m_obj2tex,
const csVector3 & v_obj2tex,
iPolygonTexture * poly_texture ) [pure virtual]

Add a polygon to this buffer.

The data pointed to by 'verts' is copied so it can be discarded after calling AddPolygon. 'mat_index' is an index in the material table (initialized with AddMaterial()). It is best to add the polygons sorted by material as that will generate the most efficient representation on hardware.

void iPolygonBuffer::SetVertexArray ( csVector3 * verts,
int num_verts ) [pure virtual]

Set vertices to use for the polygons.

The given array is copied.

The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000