1 #pragma once
2 // Description:
3 //   Bitmap Manager.
4 //
5 // Copyright (C) 2001 Frank Becker
6 //
7 // This program is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU General Public License as published by the Free Software
9 // Foundation;  either version 2 of the License,  or (at your option) any  later
10 // version.
11 //
12 // This program is distributed in the hope that it will be useful,  but  WITHOUT
13 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
15 //
16 #include <string>
17 
18 #include "ResourceCache.hpp"
19 #include "Singleton.hpp"
20 #include "GLBitmapCollection.hpp"
21 
22 class BitmapManager: public ResourceCache<GLBitmapCollection>
23 {
24 friend class Singleton<BitmapManager>;
25 public:
getBitmap(const std::string & bitmapName)26     GLBitmapCollection *getBitmap( const std::string &bitmapName)
27     {
28 #ifdef IPHONE
29 	return getResource( std::string("bitmaps/atlas"));
30 #else
31 	return getResource( bitmapName);
32 #endif
33     }
34 
35     virtual void reload( void);
36 
37 protected:
38     virtual GLBitmapCollection *load( const std::string &bitmap);
39 
40 private:
41     BitmapManager( void);
42     virtual ~BitmapManager();
43     BitmapManager( const BitmapManager&);
44     BitmapManager &operator=(const BitmapManager&);
45 };
46 
47 typedef Singleton<BitmapManager> BitmapManagerS;
48