00001 #ifndef GLT_DLCACHE_H 00002 #define GLT_DLCACHE_H 00003 00004 /* 00005 00006 GLT OpenGL C++ Toolkit 00007 Copyright (C) 2000-2002 Nigel Stewart 00008 Email: nigels.com@gmail.com WWW: http://www.nigels.com/glt/ 00009 00010 This library is free software; you can redistribute it and/or 00011 modify it under the terms of the GNU Lesser General Public 00012 License as published by the Free Software Foundation; either 00013 version 2.1 of the License, or (at your option) any later version. 00014 00015 This library is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 Lesser General Public License for more details. 00019 00020 You should have received a copy of the GNU Lesser General Public 00021 License along with this library; if not, write to the Free Software 00022 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 00024 */ 00025 00039 #include <glt/gl.h> 00040 #include <glt/config.h> 00041 #include <misc/lru.h> 00042 00043 #ifdef GLT_WIN32 00044 #pragma warning(disable : 4786) 00045 #endif 00046 00047 #include <vector> 00048 //#include <map> 00049 00051 00057 class GltDisplayListCache 00058 { 00059 public: 00060 GltDisplayListCache(const uint32 capacity = 100); 00061 virtual ~GltDisplayListCache(); 00062 00063 void draw(const uint32 seed); 00064 void clear(); 00065 00066 virtual void OnDraw(const uint32 seed) const = 0; 00067 00068 private: 00069 00070 uint32 _capacity; 00071 lru<uint32,GLuint> _lru; 00072 std::vector<GLuint> _lists; 00073 }; 00074 00075 #endif 00076