]> git.tdb.fi Git - libs/gltk.git/blob - source/resources.h
Derive Resources from DataFile::Collection
[libs/gltk.git] / source / resources.h
1 #ifndef MSP_GLTK_RESOURCES_H_
2 #define MSP_GLTK_RESOURCES_H_
3
4 #include <msp/gl/font.h>
5 #include <msp/gl/texture.h>
6 #include <msp/datafile/collection.h>
7 #include <msp/path/path.h>
8 #include "graphic.h"
9 #include "style.h"
10
11 namespace Msp {
12 namespace GLtk {
13
14 class Resources: public DataFile::Collection
15 {
16 private:
17         Path path;
18         GL::Font *default_font;
19
20 public:
21         class Loader: public Collection::Loader
22         {
23         private:
24                 Resources &res;
25
26         public:
27                 Loader(Resources &);
28         private:
29                 void font(const std::string &);
30         };
31
32         Resources();
33
34         void set_path(const Path &);
35         const GL::Font &get_default_font() const;
36 private:
37         GL::Font *create_font(const std::string &);
38         GL::Texture2D *create_texture(const std::string &);
39 };
40
41 } // namespace GLtk
42 } // namespace Msp
43
44 #endif