1 // Description:
2 //   Manager for GLTextures.
3 //
4 // Copyright (C) 2001 Frank Becker
5 //
6 // This program is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU General Public License as published by the Free Software
8 // Foundation;  either version 2 of the License,  or (at your option) any  later
9 // version.
10 //
11 // This program is distributed in the hope that it will be useful,  but  WITHOUT
12 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
14 //
15 #ifndef _TextureManager_hpp_
16 #define _TextureManager_hpp_
17 
18 #include <GLTexture.hpp>
19 #include <Singleton.hpp>
20 
21 #define MAX_TEXTURES 1024
22 class TextureManager
23 {
24 friend class Singleton<TextureManager>;
25 public:
26     int addTexture( GLTexture *tex);
27     void removeTexture( GLTexture *tex);
28 
29 protected:
30     TextureManager( void);
31     ~TextureManager();
32 
33     int findTexture( GLTexture *tex);
34     GLTexture *texArray[ MAX_TEXTURES];
35     GLuint     texIDs[ MAX_TEXTURES];
36 private:
37     int _textureCount;
38 };
39 
40 typedef Singleton<TextureManager> TextureManagerS;
41 #endif
42