1 /******************************
2 ** Tsunagari Tile Engine **
4 ** Copyright 2011 OmegaSDG **
5 ******************************/
14 #include <boost/scoped_ptr.hpp>
15 #include <Gosu/Window.hpp> // for Gosu::Window
28 This class is structurally the main class of the Tsunagari Tile Engine.
29 It handles input and drawing.
31 class GameWindow
: public Gosu::Window
34 static const GameWindow
& getWindow();
36 //! GameWindow Constructor
37 GameWindow(ClientValues
* conf
);
39 //! GameWindow Destructor
40 virtual ~GameWindow();
42 //! GameWindow Initializer
43 bool init(char** argv
);
45 //! Width of the window in pixels.
48 //! Height of the window in pixels.
52 void buttonDown(const Gosu::Button btn
);
55 void buttonUp(const Gosu::Button btn
);
61 bool needsRedraw() const;
66 //! Syncronized time value used throughout the engine
70 //! Calculate time passed since engine state was last updated
73 //! Process persistent keyboard input
74 void handleKeyboardInput();
76 boost::scoped_ptr
<Resourcer
> rc
;
77 boost::scoped_ptr
<World
> world
;
79 //! Last time engine state was updated.
82 //! Milliseconds that have passed since engine last updated.
85 //! Milliseconds that have passed since game started. Loops on overflow.
88 //! Call the garbage colelctor once a second.
94 bool consecutive
, initiallyResolved
;
98 std::map
<Gosu::Button
, keystate
> keystates
;