Hosting courtesy of Sourceforge

SourceForge Logo
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ImageManager.h

Go to the documentation of this file.
00001 //
00002 //      Copyright (C) 2002 Robert Renaud
00003 //
00004 //      This program is free software; you can redistribute it and/or
00005 //      modify it under the terms of the GNU General Public License
00006 //      as published by the Free Software Foundation; either version 2
00007 //      of the License, or (at your option) any later version.
00008 //
00009 //      This program 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.  
00012 //
00013 //      See the GNU General Public License for more details.
00014 //
00015 //      You should have received a copy of the GNU General Public License
00016 //      along with this program; if not, write to the Free Software
00017 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018 //
00019 
00020 #ifndef IMAGE_MANAGER_H_
00021 #define IMAGE_MANAGER_H_
00022 
00023 #include "../Config.h"
00024 
00025 #include "GraphicsDebug.h"
00026 #include "../Util/GeneralException.h"
00027 
00028 #include "SDL.h"
00029 
00030 #include <string>
00031 #include <vector>
00032 #include <map>
00033 
00034 using namespace std;
00035 
00036 namespace Graphics {
00037         
00055         class ImageManager {
00056         public: 
00062                 SDL_Surface* getImage(const string& str);
00063                 
00066                 static ImageManager* getInstance();
00067 
00071                 static void destroy();
00072                 
00074                 void freeAll();
00075                 
00077                 void freeBMP(const string& str);
00078 
00080                 void freeBMP(SDL_Surface* surf);
00081                 
00082                 ~ImageManager();
00083         private:                
00084                 static ImageManager* instance;
00085                 
00086                 typedef map<string,SDL_Surface*> mapStrSurf;
00087                 mapStrSurf nameReferenceTable;          
00088                 
00089                 void removeFromTable(mapStrSurf::iterator &i);
00090                 
00091                 ImageManager();
00092                 
00093         #ifdef DEBUG_GRAPHICS_IMAGE_MANAGER
00094         public:
00095                 void debugPrintPairs();
00096         #endif
00097         };
00098 };  // namespace Graphics
00099 
00100 #endif // ifndef IMAGE_MANAGER_H_
00101 

Generated on Tue May 21 07:26:51 2002 for BomberLAN by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001