![]()
|
vbufmgr.h00001 /* 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 __IVIDEO_VBUFMGR_H__ 00021 #define __IVIDEO_VBUFMGR_H__ 00022 00023 #include "csutil/scf.h" 00024 00025 class csMatrix3; 00026 class csPlane3; 00027 class csVector3; 00028 class csVector2; 00029 class csColor; 00030 struct iPolygonTexture; 00031 struct iMaterialHandle; 00032 00033 SCF_VERSION (iVertexBuffer, 0, 1, 0); 00034 00042 struct iVertexBuffer : public iBase 00043 { 00045 virtual int GetPriority () const = 0; 00047 virtual bool IsLocked () const = 0; 00051 virtual csVector3* GetVertices () const = 0; 00055 virtual csVector2* GetTexels () const = 0; 00059 virtual csColor* GetColors () const = 0; 00063 virtual int GetVertexCount () const = 0; 00064 }; 00065 00066 SCF_VERSION (iPolygonBuffer, 0, 0, 3); 00067 00079 struct iPolygonBuffer : public iBase 00080 { 00089 virtual void AddPolygon (int* verts, int num_verts, 00090 const csPlane3& poly_normal, 00091 int mat_index, 00092 const csMatrix3& m_obj2tex, const csVector3& v_obj2tex, 00093 iPolygonTexture* poly_texture) = 0; 00094 00099 virtual void SetVertexArray (csVector3* verts, int num_verts) = 0; 00100 00104 virtual void AddMaterial (iMaterialHandle* mat_handle) = 0; 00108 virtual int GetMaterialCount () const = 0; 00112 virtual iMaterialHandle* GetMaterial (int idx) const = 0; 00113 00115 virtual int GetVertexCount() const = 0; 00116 00118 00119 virtual csVector3* GetVertices() const = 0; 00120 00125 virtual void SetMaterial (int idx, iMaterialHandle* mat_handle) = 0; 00126 00128 virtual void Clear () = 0; 00129 }; 00130 00131 SCF_VERSION (iVertexBufferManagerClient, 0, 0, 1); 00132 00139 struct iVertexBufferManagerClient : public iBase 00140 { 00145 virtual void ManagerClosing () = 0; 00146 }; 00147 00148 SCF_VERSION (iVertexBufferManager, 0, 0, 2); 00149 00154 struct iVertexBufferManager : public iBase 00155 { 00156 //---------- Vertex Buffers ----------------------------------------------- 00157 00166 virtual iVertexBuffer* CreateBuffer (int priority) = 0; 00167 00172 virtual void ChangePriority (iVertexBuffer* buf, int new_priority) = 0; 00173 00187 virtual bool LockBuffer (iVertexBuffer* buf, 00188 csVector3* verts, 00189 csVector2* texels, 00190 csColor* colors, 00191 int num_verts, int buf_number) = 0; 00192 00196 virtual void UnlockBuffer (iVertexBuffer* buf) = 0; 00197 00198 //---------- Polygon Buffers ----------------------------------------------- 00199 00204 virtual iPolygonBuffer* CreatePolygonBuffer () = 0; 00205 00206 //---------- client handling ----------------------------------------------- 00207 00212 virtual void AddClient (iVertexBufferManagerClient *client) = 0; 00213 virtual void RemoveClient (iVertexBufferManagerClient *client) = 0; 00214 }; 00215 00216 #endif // __IVIDEO_VBUFMGR_H__ 00217 Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000 |