equal
deleted
inserted
replaced
7 #include "Input.hh" |
7 #include "Input.hh" |
8 #include "Timer.hh" |
8 #include "Timer.hh" |
9 #include "Engine.hh" |
9 #include "Engine.hh" |
10 #include "Config.hh" |
10 #include "Config.hh" |
11 |
11 |
|
12 #include "GameMessageView.hh" |
|
13 |
12 #include <ClanLib/core.h> |
14 #include <ClanLib/core.h> |
13 #include <ClanLib/gl.h> |
15 #include <ClanLib/gl.h> |
14 #include <ClanLib/display.h> |
16 #include <ClanLib/display.h> |
15 |
17 |
16 /** |
18 /** |
17 * This handles drawing the GameState with an appropriate camera view each frame, loading fonts, and currently, |
19 * This handles drawing the GameState with an appropriate camera view each frame, loading fonts, and currently, |
18 * handling the input from Input to GameState. |
20 * handling the input from Input to GameState. |
19 */ |
21 */ |
20 class Graphics : public CL_DisplayWindow { |
22 class Graphics : public GameStateEventHandler, public CL_DisplayWindow { |
21 private: |
23 private: |
22 Engine &engine; |
24 Engine &engine; |
23 GameState &state; |
25 GameState &state; |
24 |
26 |
25 PixelCoordinate resolution; |
27 PixelCoordinate resolution; |
33 // current GUI input state |
35 // current GUI input state |
34 GuiInput flags; |
36 GuiInput flags; |
35 |
37 |
36 // basic fonts |
38 // basic fonts |
37 CL_Font simple_font; |
39 CL_Font simple_font; |
|
40 |
|
41 // view components |
|
42 GameMessageView message_view; |
38 |
43 |
39 public: |
44 public: |
40 Graphics (Engine &engine, GameState &state, PixelCoordinate resolution, bool fullscreen); |
45 Graphics (Engine &engine, GameState &state, PixelCoordinate resolution, bool fullscreen); |
41 |
46 |
42 /** |
47 /** |
71 void do_redraw (void); |
76 void do_redraw (void); |
72 |
77 |
73 void on_update (TimeMS tick_length); |
78 void on_update (TimeMS tick_length); |
74 |
79 |
75 void draw_player_info(CL_GraphicContext *gc, Player *p); |
80 void draw_player_info(CL_GraphicContext *gc, Player *p); |
|
81 |
|
82 protected: |
|
83 /* GameStateEventHandler */ |
|
84 virtual void on_player_joined (Player *p); |
|
85 virtual void on_player_left (Player *p); |
76 }; |
86 }; |
77 |
87 |
78 #endif /* GRAPHICS_HH */ |
88 #endif /* GRAPHICS_HH */ |