Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
libstage
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
{
19
class
TextureManager
{
20
private
:
21
TextureManager
(
void
) { }
22
23
public
:
24
25
//TODO figure out where to store standard textures
26
GLuint
_stall_texture_id
;
27
GLuint
_mains_texture_id
;
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_
Stg::TextureManager::loadTexture
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
Stg
The Stage library uses its own namespace.
Definition:
canvas.hh:8
Stg::TextureManager::getInstance
static TextureManager & getInstance(void)
Definition:
texture_manager.hh:30
stage.hh
Stg::TextureManager::_mains_texture_id
GLuint _mains_texture_id
Definition:
texture_manager.hh:27
Stg::TextureManager::_stall_texture_id
GLuint _stall_texture_id
Definition:
texture_manager.hh:26
Stg::TextureManager
Singleton for loading textures (not threadsafe)
Definition:
texture_manager.hh:19
Stg::TextureManager::TextureManager
TextureManager(void)
Definition:
texture_manager.hh:21
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