Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages
userrndbuf.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2003 by Philipp Aumayr 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_CSTOOL_USERRNDBUF_H__ 00020 #define __CS_CSTOOL_USERRNDBUF_H__ 00021 00025 #include "csextern.h" 00026 00027 #include "csutil/ref.h" 00028 #include "csutil/dirtyaccessarray.h" 00029 #include "csutil/refarr.h" 00030 #include "csutil/objreg.h" 00031 #include "ivideo/rndbuf.h" 00032 #include "iutil/strset.h" 00033 00034 SCF_VERSION(iUserRenderBufferIterator, 0, 0, 1); 00035 00039 struct iUserRenderBufferIterator : public iBase 00040 { 00042 virtual bool HasNext() = 0; 00044 virtual csStringID Next (csRef<iRenderBuffer>* buf = 0) = 0; 00046 virtual void Reset() = 0; 00047 }; 00048 00053 class CS_CSTOOL_EXPORT csUserRenderBufferManager 00054 { 00055 struct userbuffer 00056 { 00057 csRef<iRenderBuffer> buf; 00058 csStringID name; 00059 }; 00060 class UserBufArrayCmp : public csArrayCmp<userbuffer, csStringID> 00061 { 00062 static int BufKeyCompare (userbuffer const& b, csStringID const& k) 00063 { 00064 return b.name - k; 00065 } 00066 public: 00067 UserBufArrayCmp (csStringID key) : 00068 csArrayCmp<userbuffer, csStringID> (key, &BufKeyCompare) 00069 { 00070 } 00071 }; 00072 static int BufCompare (userbuffer const& r, userbuffer const& k); 00073 00074 csArray<userbuffer> userBuffers; 00075 public: 00077 iRenderBuffer* GetRenderBuffer (csStringID name) const; 00082 bool AddRenderBuffer (csStringID name, iRenderBuffer* buffer); 00087 bool RemoveRenderBuffer (csStringID name); 00088 00089 csRef<iUserRenderBufferIterator> GetBuffers() const; 00090 }; 00091 00092 #endif // __CS_CSTOOL_USERRNDBUF_H__
Generated for Crystal Space by doxygen 1.3.9.1