texture_manager.hh
Go to the documentation of this file.
1 /*
2  * texture_manager.hh
3  * Stage
4  *
5  * Singleton class for loading textures
6  *
7  */
8 #ifndef _TEXTURE_MANAGER_H_
9 #define _TEXTURE_MANAGER_H_
10 
11 #include "stage.hh"
12 
13 #include <FL/Fl_Shared_Image.H>
14 #include <iostream>
15 
16 namespace Stg
17 {
20  private:
21  TextureManager( void ) { }
22 
23  public:
24 
25  //TODO figure out where to store standard textures
28 
29  //TODO make this threadsafe
30  static TextureManager& getInstance( void )
31  {
32  static TextureManager* the_instance = NULL;
33  //TODO add a lock here
34  if( the_instance == NULL ) {
35  the_instance = new TextureManager;
36  }
37  return *the_instance;
38  }
39 
41  GLuint loadTexture( const char *filename );
42 
43  };
44 }
45 #endif //_TEXTURE_MANAGER_H_