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_
GLuint loadTexture(const char *filename)
load a texture on the GPU, returned value is the texture ID, or 0 for failure
The Stage library uses its own namespace.
Definition: canvas.hh:8
static TextureManager & getInstance(void)
Singleton for loading textures (not threadsafe)


stage
Author(s): Richard Vaughan , Brian Gerkey , Reed Hedges , Andrew Howard , Toby Collett , Pooya Karimian , Jeremy Asher , Alex Couture-Beil , Geoff Biggs , Rich Mattes , Abbas Sadat
autogenerated on Mon Jun 10 2019 15:06:10