]> git.tdb.fi Git - libs/gltk.git/blob - source/style.cpp
b4ee82d10eff5d1e454ebf767430d0edd941ed17
[libs/gltk.git] / source / style.cpp
1 #include "resources.h"
2 #include "style.h"
3
4 using namespace std;
5
6 namespace Msp {
7 namespace GLtk {
8
9 Style::Style():
10         font(0)
11 { }
12
13
14 Style::Loader::Loader(Style &s, Resources &r):
15         style(s),
16         res(r)
17 {
18         add("font",       &Style::font);
19         add("font_color", &Loader::font_color);
20         add("part",       &Loader::part);
21 }
22
23 void Style::Loader::font_color(float r, float g, float b)
24 {
25         style.font_color=GL::Color(r, g, b);
26 }
27
28 void Style::Loader::part(const string &n)
29 {
30         Part p(n);
31         load_sub(p, res);
32         style.parts.push_back(p);
33 }
34
35 } // namespace GLtk
36 } // namespace Msp