00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://www.ogre3d.org/ 00006 00007 Copyright © 2000-2002 The OGRE Team 00008 Also see acknowledgements in Readme.html 00009 00010 This program is free software; you can redistribute it and/or modify it under 00011 the terms of the GNU Lesser General Public License as published by the Free Software 00012 Foundation; either version 2 of the License, or (at your option) any later 00013 version. 00014 00015 This program is distributed in the hope that it will be useful, but WITHOUT 00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License along with 00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00022 http://www.gnu.org/copyleft/lesser.txt. 00023 ----------------------------------------------------------------------------- 00024 */ 00025 #ifndef __HardwareBufferManager__ 00026 #define __HardwareBufferManager__ 00027 00028 // Precompiler options 00029 #include "OgrePrerequisites.h" 00030 00031 #include "OgreSingleton.h" 00032 #include "OgreHardwareVertexBuffer.h" 00033 #include "OgreHardwareIndexBuffer.h" 00034 00035 00036 namespace Ogre { 00037 00040 class _OgreExport HardwareBufferManager : public Singleton<HardwareBufferManager> 00041 { 00042 friend class HardwareVertexBufferSharedPtr; 00043 friend class HardwareIndexBufferSharedPtr; 00044 protected: 00045 typedef std::list<VertexDeclaration*> VertexDeclarationList; 00046 typedef std::list<VertexBufferBinding*> VertexBufferBindingList; 00047 typedef std::set<HardwareVertexBuffer*> VertexBufferList; 00048 typedef std::set<HardwareIndexBuffer*> IndexBufferList; 00049 00050 VertexDeclarationList mVertexDeclarations; 00051 VertexBufferBindingList mVertexBufferBindings; 00052 VertexBufferList mVertexBuffers; 00053 IndexBufferList mIndexBuffers; 00054 00055 00057 virtual void destroyVertexBuffer(HardwareVertexBuffer* buf) = 0; 00059 virtual void destroyIndexBuffer(HardwareIndexBuffer* buf) = 0; 00060 00061 virtual void destroyAllDeclarations(void); 00062 virtual void destroyAllBindings(void); 00063 public: 00064 HardwareBufferManager(); 00065 virtual ~HardwareBufferManager(); 00094 virtual HardwareVertexBufferSharedPtr 00095 createVertexBuffer(size_t vertexSize, size_t numVerts, HardwareBuffer::Usage usage, 00096 bool useShadowBuffer = false) = 0; 00113 virtual HardwareIndexBufferSharedPtr 00114 createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, 00115 HardwareBuffer::Usage usage, bool useShadowBuffer = false) = 0; 00117 virtual VertexDeclaration* createVertexDeclaration(void); 00119 virtual void destroyVertexDeclaration(VertexDeclaration* decl); 00120 00122 virtual VertexBufferBinding* createVertexBufferBinding(void); 00124 virtual void destroyVertexBufferBinding(VertexBufferBinding* binding); 00125 00141 static HardwareBufferManager& getSingleton(void); 00142 }; 00143 00144 } 00145 00146 #endif 00147
Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:10:13 2004