equal
deleted
inserted
replaced
|
1 #ifndef GRAPHICS_GRAPHICS_HH |
|
2 #define GRAPHICS_GRAPHICS_HH |
|
3 |
|
4 #include "../Engine.hh" |
|
5 #include "Display.hh" |
|
6 #include "FontManager.hh" |
|
7 #include "GameView.hh" |
|
8 |
|
9 namespace graphics |
|
10 { |
|
11 |
|
12 /** |
|
13 * Core class that ties everything else together |
|
14 */ |
|
15 class Graphics { |
|
16 public: |
|
17 /** |
|
18 * Our reference to the engine |
|
19 */ |
|
20 Engine &engine; |
|
21 |
|
22 /** |
|
23 * For loading fonts |
|
24 */ |
|
25 FontManager fonts; |
|
26 |
|
27 /** |
|
28 * Our primary display |
|
29 */ |
|
30 Display display; |
|
31 |
|
32 /** |
|
33 * Initialize the graphics subsystem |
|
34 */ |
|
35 Graphics (Engine &engine, CL_ResourceManager &resources, const DisplayConfig &display_config); |
|
36 |
|
37 /** |
|
38 * Display a new GameView |
|
39 */ |
|
40 void displayGameView (GameState &state, LocalPlayer *player) { |
|
41 // allocate a new GameView |
|
42 GameView *view = new GameView(state, player); |
|
43 |
|
44 // assign it to the display |
|
45 display.setTarget(view); |
|
46 } |
|
47 |
|
48 }; |
|
49 |
|
50 /** |
|
51 * The global Graphics instance |
|
52 */ |
|
53 extern Graphics *graphics; |
|
54 |
|
55 } |
|
56 |
|
57 #endif |