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 {
19 private:
20  TextureManager(void) {}
21 public:
22  // TODO figure out where to store standard textures
25 
26  // TODO make this threadsafe
28  {
29  static TextureManager *the_instance = NULL;
30  // TODO add a lock here
31  if (the_instance == NULL) {
32  the_instance = new TextureManager;
33  }
34  return *the_instance;
35  }
36 
38  GLuint loadTexture(const char *filename);
39 };
40 }
41 #endif //_TEXTURE_MANAGER_H_
static TextureManager & getInstance(void)
Definition: texture_manager.hh:27
GLuint _stall_texture_id
Definition: texture_manager.hh:23
GLuint loadTexture(const char *filename)
load a texture on the GPU, returned value is the texture ID, or 0 for failure
Definition: texture_manager.cc:14
Singleton for loading textures (not threadsafe)
Definition: texture_manager.hh:18
The Stage library uses its own namespace.
Definition: canvas.hh:8
GLuint _mains_texture_id
Definition: texture_manager.hh:24