#include <vbufmgr.h>
Inheritance diagram for iPolygonBuffer:
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 iMaterialHandle* | GetMaterial (int idx) const=0 |
Get a material. | |
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. |
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).
|
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. |
|
Set vertices to use for the polygons. The given array is copied. |