CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

iPolygonBuffer Struct Reference
[3D]

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. More...

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

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

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

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

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

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

virtual void Prepare ()=0
 After adding everything and before using this polygon buffer you should call Prepare(). More...

virtual void MarkLightmapsDirty ()=0
 Sets the polygon buffer as dirty. More...

virtual const csBox3GetBoundingBox () const=0
 Get a bounding box for all the vertices. More...


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).

Definition at line 102 of file vbufmgr.h.


Member Function Documentation

virtual void iPolygonBuffer::AddMaterial iMaterialHandle   mat_handle [pure virtual]
 

Add a material.

virtual 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.

virtual void iPolygonBuffer::Clear   [pure virtual]
 

Clear all polygons, materials, and vertex array.

virtual const csBox3& iPolygonBuffer::GetBoundingBox   const [pure virtual]
 

Get a bounding box for all the vertices.

virtual iMaterialHandle* iPolygonBuffer::GetMaterial int    idx const [pure virtual]
 

Get a material.

virtual int iPolygonBuffer::GetMaterialCount   const [pure virtual]
 

Get the number of materials.

virtual int iPolygonBuffer::GetVertexCount   const [pure virtual]
 

Gets the numebr of vertices.

virtual csVector3* iPolygonBuffer::GetVertices   const [pure virtual]
 

Gets the array of vertices.

virtual void iPolygonBuffer::MarkLightmapsDirty   [pure virtual]
 

Sets the polygon buffer as dirty.

This means that the mesh is affected by some light.

virtual void iPolygonBuffer::Prepare   [pure virtual]
 

After adding everything and before using this polygon buffer you should call Prepare().

virtual void iPolygonBuffer::SetMaterial int    idx,
iMaterialHandle   mat_handle
[pure virtual]
 

Set a previously added material (this can be used to change a material handle).

virtual 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.14