20 |
#include <memory> |
#include <memory> |
21 |
#include <boost/filesystem/path.hpp> |
#include <boost/filesystem/path.hpp> |
22 |
#include <boost/shared_ptr.hpp> |
#include <boost/shared_ptr.hpp> |
23 |
|
#include "texture-meta.hpp" |
24 |
|
#include "resource-manager.hpp" |
25 |
namespace usata |
namespace usata |
26 |
{ |
{ |
27 |
|
|
38 |
void allocate_gltex (void); |
void allocate_gltex (void); |
39 |
public: |
public: |
40 |
Texture(const TextureMeta*); |
Texture(const TextureMeta*); |
41 |
|
Texture(const TextureMeta&); |
42 |
bool reload(const TextureMeta*); |
bool reload(const TextureMeta*); |
43 |
GLuint get_tex() { return tex_id; } |
GLuint get_tex() { return tex_id; } |
44 |
~Texture(); |
~Texture(); |
46 |
|
|
47 |
typedef boost::shared_ptr<Texture> Texture_sp; |
typedef boost::shared_ptr<Texture> Texture_sp; |
48 |
|
|
49 |
|
class ImageManager : public ResourceManager<Texture, TextureMeta, std::string> |
50 |
|
{ |
51 |
|
typedef resource Image_sp; |
52 |
|
public: |
53 |
|
Image_sp get(const std::string& name); |
54 |
|
void meta_add(const TextureMeta*); |
55 |
|
void load_path(const boost::filesystem::path&); |
56 |
|
}; |
57 |
|
|
58 |
class TextureManager |
class TextureManager |
59 |
{ |
{ |
60 |
std::auto_ptr<TextureManagerImpl> impl; |
std::auto_ptr<TextureManagerImpl> impl; |