author | Tero Marttila <terom@fixme.fi> |
Wed, 21 Jan 2009 03:33:35 +0200 | |
branch | new_graphics |
changeset 411 | 106aaf6eadfe |
permissions | -rw-r--r-- |
411
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
#ifndef GRAPHICS_FONT_MANAGER_HH |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
#define GRAPHICS_FONT_MANAGER_HH |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
3 |
|
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
4 |
#include <ClanLib/display.h> |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
5 |
|
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
6 |
namespace graphics |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
7 |
{ |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
8 |
|
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
9 |
/** |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
10 |
* Loads fonts and lets other components use them |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
11 |
*/ |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
12 |
class FontManager { |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
13 |
private: |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
14 |
/** |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
15 |
* Our resource manager for loading these |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
16 |
*/ |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
17 |
CL_ResourceManager &resources; |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
18 |
|
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
19 |
/** |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
20 |
* A basic monospace font |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
21 |
*/ |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
22 |
CL_Font simple_font; |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
23 |
|
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
24 |
public: |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
25 |
/** |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
26 |
* Load fonts |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
27 |
*/ |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
28 |
FontManager (CL_ResourceManager &resources) : |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
29 |
resources(resources), simple_font("Font2", &resources) |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
30 |
{ |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
31 |
|
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
32 |
} |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
33 |
|
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
34 |
/** |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
35 |
* Returns a CL_Font that can be used for drawing text |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
36 |
*/ |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
37 |
CL_Font& getSimpleFont (void) { return simple_font; } |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
38 |
}; |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
39 |
|
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
40 |
|
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
41 |
} |
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
42 |
|
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
43 |
#endif |