CrystalSpace

Public API Reference

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

ivideo/vbufmgr.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2001 by Jorrit Tyberghein
00003     Written by Jorrit Tyberghein.
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 #ifndef __CS_IVIDEO_VBUFMGR_H__
00021 #define __CS_IVIDEO_VBUFMGR_H__
00022 
00031 #include "csutil/scf.h"
00032 #include "ivideo/txtmgr.h"
00033 
00034 class csBox3;
00035 class csMatrix3;
00036 class csPlane3;
00037 class csVector3;
00038 class csVector2;
00039 class csColor;
00040 class csTransform;
00041 struct iMaterialHandle;
00042 struct csPolyTextureMapping;
00043 
00044 SCF_VERSION (iVertexBuffer, 0, 1, 1);
00045 
00054 struct iVertexBuffer : public iBase
00055 {
00057   virtual int GetPriority () const = 0;
00059   virtual bool IsLocked () const = 0;
00063   virtual csVector3* GetVertices () const = 0;
00067   virtual csVector2* GetTexels () const = 0;
00071   virtual csColor* GetColors () const = 0;
00075   virtual float* GetUserArray (int index) const = 0;
00079   virtual int GetUserArrayComponentCount (int index) const = 0;
00083   virtual int GetVertexCount () const = 0;
00087   virtual const csBox3& GetBoundingBox () const = 0;
00088 };
00089 
00090 SCF_VERSION (iPolygonBuffer, 0, 3, 0);
00091 
00104 struct iPolygonBuffer : public iBase
00105 {
00110   virtual void SetVertexArray (csVector3* verts, int num_verts) = 0;
00114   virtual int GetVertexCount () const = 0;
00118   virtual csVector3* GetVertices () const = 0;
00122   virtual void AddMaterial (iMaterialHandle* mat_handle) = 0;
00126   virtual int GetMaterialCount () const = 0;
00130   virtual iMaterialHandle* GetMaterial (int idx) const = 0;
00131 
00136   virtual void SetMaterial (int idx, iMaterialHandle* mat_handle) = 0;
00137 
00139   virtual void Clear () = 0;
00140 
00145   virtual void Prepare () = 0;
00146 
00151   virtual void MarkLightmapsDirty () = 0;
00152 
00156   virtual const csBox3& GetBoundingBox () const = 0;
00157 
00166   virtual void AddPolygon (int num_verts,
00167         int* verts,
00168         csPolyTextureMapping* texmap,
00169         const csPlane3& poly_normal,
00170         int mat_index,
00171         iRendererLightmap* lm) = 0;
00172 };
00173 
00174 SCF_VERSION (iVertexBufferManagerClient, 0, 0, 1);
00175 
00182 struct iVertexBufferManagerClient : public iBase
00183 {
00188   virtual void ManagerClosing () = 0;
00189 };
00190 
00191 SCF_VERSION (iVertexBufferManager, 0, 0, 2);
00192 
00198 struct iVertexBufferManager : public iBase
00199 {
00200   //---------- Vertex Buffers -----------------------------------------------
00201 
00210   virtual csPtr<iVertexBuffer> CreateBuffer (int priority) = 0;
00211 
00216   virtual void ChangePriority (iVertexBuffer* buf, int new_priority) = 0;
00217 
00231   virtual bool LockBuffer (iVertexBuffer* buf,
00232         csVector3* verts,
00233         csVector2* texels,
00234         csColor* colors,
00235         int num_verts, int buf_number,
00236         const csBox3& bbox) = 0;
00237 
00238   virtual bool LockUserArray (iVertexBuffer* buf,
00239         int index, float* user, 
00240         int num_components, int buf_number) = 0;
00241 
00245   virtual void UnlockBuffer (iVertexBuffer* buf) = 0;
00246 
00247   //---------- Polygon Buffers -----------------------------------------------
00248 
00253   virtual iPolygonBuffer* CreatePolygonBuffer () = 0;
00254 
00255   //---------- client handling -----------------------------------------------
00256 
00261   virtual void AddClient (iVertexBufferManagerClient *client) = 0;
00262   virtual void RemoveClient (iVertexBufferManagerClient *client) = 0;
00263 };
00264 
00267 #endif // __CS_IVIDEO_VBUFMGR_H__
00268 

Generated for Crystal Space by doxygen 1.2.18