Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tag: v4.1.0
Fetching contributors…

Cannot retrieve contributors at this time

46 lines (37 sloc) 0.909 kB
/*
* texture_manager.hh
* Stage
*
* Singleton class for loading textures
*
*/
#ifndef _TEXTURE_MANAGER_H_
#define _TEXTURE_MANAGER_H_
#include "stage.hh"
#include <FL/Fl_Shared_Image.H>
#include <iostream>
namespace Stg
{
///Singleton for loading textures (not threadsafe)
class TextureManager {
private:
TextureManager( void ) { }
public:
//TODO figure out where to store standard textures
GLuint _stall_texture_id;
GLuint _mains_texture_id;
//TODO make this threadsafe
static TextureManager& getInstance( void )
{
static TextureManager* the_instance = NULL;
//TODO add a lock here
if( the_instance == NULL ) {
the_instance = new TextureManager;
}
return *the_instance;
}
///load a texture on the GPU, returned value is the texture ID, or 0 for failure
GLuint loadTexture( const char *filename );
};
}
#endif //_TEXTURE_MANAGER_H_
Jump to Line
Something went wrong with that request. Please try again.