CrystalSpace

Public API Reference

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

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 
00023 #ifndef CS_USE_NEW_RENDERER
00024 
00033 #include "csutil/scf.h"
00034 
00035 class csBox3;
00036 class csMatrix3;
00037 class csPlane3;
00038 class csVector3;
00039 class csVector2;
00040 class csColor;
00041 struct iPolygonTexture;
00042 struct iMaterialHandle;
00043 
00044 SCF_VERSION (iVertexBuffer, 0, 1, 1);
00045 
00053 struct iVertexBuffer : public iBase
00054 {
00056   virtual int GetPriority () const = 0;
00058   virtual bool IsLocked () const = 0;
00062   virtual csVector3* GetVertices () const = 0;
00066   virtual csVector2* GetTexels () const = 0;
00070   virtual csColor* GetColors () const = 0;
00074   virtual float* GetUserArray (int index) const = 0;
00078   virtual int GetUserArrayComponentCount (int index) const = 0;
00082   virtual int GetVertexCount () const = 0;
00086   virtual const csBox3& GetBoundingBox () const = 0;
00087 };
00088 
00089 SCF_VERSION (iPolygonBuffer, 0, 1, 1);
00090 
00102 struct iPolygonBuffer : public iBase
00103 {
00112   virtual void AddPolygon (int* verts, int num_verts,
00113         const csPlane3& poly_normal,
00114         int mat_index,
00115         const csMatrix3& m_obj2tex, const csVector3& v_obj2tex,
00116         iPolygonTexture* poly_texture) = 0;
00117 
00122   virtual void SetVertexArray (csVector3* verts, int num_verts) = 0;
00123 
00127   virtual void AddMaterial (iMaterialHandle* mat_handle) = 0;
00131   virtual int GetMaterialCount () const = 0;
00135   virtual iMaterialHandle* GetMaterial (int idx) const = 0;
00136 
00138   virtual int GetVertexCount() const = 0;
00139 
00141 
00142   virtual csVector3* GetVertices() const = 0;
00143 
00148   virtual void SetMaterial (int idx, iMaterialHandle* mat_handle) = 0;
00149 
00151   virtual void Clear () = 0;
00152 
00157   virtual void Prepare () = 0;
00158 
00163   virtual void MarkLightmapsDirty () = 0;
00164 
00168   virtual const csBox3& GetBoundingBox () const = 0;
00169 };
00170 
00171 SCF_VERSION (iVertexBufferManagerClient, 0, 0, 1);
00172 
00179 struct iVertexBufferManagerClient : public iBase
00180 {
00185   virtual void ManagerClosing () = 0;
00186 };
00187 
00188 SCF_VERSION (iVertexBufferManager, 0, 0, 2);
00189 
00194 struct iVertexBufferManager : public iBase
00195 {
00196   //---------- Vertex Buffers -----------------------------------------------
00197 
00206   virtual csPtr<iVertexBuffer> CreateBuffer (int priority) = 0;
00207 
00212   virtual void ChangePriority (iVertexBuffer* buf, int new_priority) = 0;
00213 
00227   virtual bool LockBuffer (iVertexBuffer* buf,
00228         csVector3* verts,
00229         csVector2* texels,
00230         csColor* colors,
00231         int num_verts, int buf_number,
00232         const csBox3& bbox) = 0;
00233 
00234   virtual bool LockUserArray (iVertexBuffer* buf,
00235         int index, float* user, 
00236         int num_components, int buf_number) = 0;
00237 
00241   virtual void UnlockBuffer (iVertexBuffer* buf) = 0;
00242 
00243   //---------- Polygon Buffers -----------------------------------------------
00244 
00249   virtual iPolygonBuffer* CreatePolygonBuffer () = 0;
00250 
00251   //---------- client handling -----------------------------------------------
00252 
00257   virtual void AddClient (iVertexBufferManagerClient *client) = 0;
00258   virtual void RemoveClient (iVertexBufferManagerClient *client) = 0;
00259 };
00260 
00261 #endif // CS_USE_NEW_RENDERER
00262 
00265 #endif // __CS_IVIDEO_VBUFMGR_H__
00266 

Generated for Crystal Space by doxygen 1.2.14