CrystalSpace

Public API Reference

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

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 iPolygonTexture;
00042 struct iMaterialHandle;
00043 struct csPolyTextureMapping;
00044 struct csPolyLightMapMapping;
00045 
00046 SCF_VERSION (iVertexBuffer, 0, 1, 1);
00047 
00056 struct iVertexBuffer : public iBase
00057 {
00059   virtual int GetPriority () const = 0;
00061   virtual bool IsLocked () const = 0;
00065   virtual csVector3* GetVertices () const = 0;
00069   virtual csVector2* GetTexels () const = 0;
00073   virtual csColor* GetColors () const = 0;
00077   virtual float* GetUserArray (int index) const = 0;
00081   virtual int GetUserArrayComponentCount (int index) const = 0;
00085   virtual int GetVertexCount () const = 0;
00089   virtual const csBox3& GetBoundingBox () const = 0;
00090 };
00091 
00092 SCF_VERSION (iPolygonBuffer, 0, 3, 0);
00093 
00106 struct iPolygonBuffer : public iBase
00107 {
00112   virtual void SetVertexArray (csVector3* verts, int num_verts) = 0;
00116   virtual int iPolygonBuffer::GetVertexCount () const = 0;
00120   virtual csVector3* iPolygonBuffer::GetVertices () const = 0;
00124   virtual void AddMaterial (iMaterialHandle* mat_handle) = 0;
00128   virtual int GetMaterialCount () const = 0;
00132   virtual iMaterialHandle* GetMaterial (int idx) const = 0;
00133 
00138   virtual void SetMaterial (int idx, iMaterialHandle* mat_handle) = 0;
00139 
00141   virtual void Clear () = 0;
00142 
00147   virtual void Prepare () = 0;
00148 
00153   virtual void MarkLightmapsDirty () = 0;
00154 
00158   virtual const csBox3& GetBoundingBox () const = 0;
00159 
00168   virtual void AddPolygon (int num_verts,
00169         int* verts,
00170         csPolyTextureMapping* texmap,
00171         csPolyLightMapMapping* lmap,
00172         const csPlane3& poly_normal,
00173         int mat_index,
00174         iRendererLightmap* lm) = 0;
00175 };
00176 
00177 SCF_VERSION (iVertexBufferManagerClient, 0, 0, 1);
00178 
00185 struct iVertexBufferManagerClient : public iBase
00186 {
00191   virtual void ManagerClosing () = 0;
00192 };
00193 
00194 SCF_VERSION (iVertexBufferManager, 0, 0, 2);
00195 
00201 struct iVertexBufferManager : public iBase
00202 {
00203   //---------- Vertex Buffers -----------------------------------------------
00204 
00213   virtual csPtr<iVertexBuffer> CreateBuffer (int priority) = 0;
00214 
00219   virtual void ChangePriority (iVertexBuffer* buf, int new_priority) = 0;
00220 
00234   virtual bool LockBuffer (iVertexBuffer* buf,
00235         csVector3* verts,
00236         csVector2* texels,
00237         csColor* colors,
00238         int num_verts, int buf_number,
00239         const csBox3& bbox) = 0;
00240 
00241   virtual bool LockUserArray (iVertexBuffer* buf,
00242         int index, float* user, 
00243         int num_components, int buf_number) = 0;
00244 
00248   virtual void UnlockBuffer (iVertexBuffer* buf) = 0;
00249 
00250   //---------- Polygon Buffers -----------------------------------------------
00251 
00256   virtual iPolygonBuffer* CreatePolygonBuffer () = 0;
00257 
00258   //---------- client handling -----------------------------------------------
00259 
00264   virtual void AddClient (iVertexBufferManagerClient *client) = 0;
00265   virtual void RemoveClient (iVertexBufferManagerClient *client) = 0;
00266 };
00267 
00270 #endif // __CS_IVIDEO_VBUFMGR_H__
00271 

Generated for Crystal Space by doxygen 1.2.14