1 /******************************
2 ** Tsunagari Tile Engine **
4 ** Copyright 2011 OmegaSDG **
5 ******************************/
14 #include <boost/scoped_ptr.hpp>
15 #include <Gosu/Window.hpp>
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 GameWindow
& getWindow();
36 //! GameWindow Constructor
37 GameWindow(unsigned x
, unsigned y
, bool fullscreen
);
39 //! GameWindow Destructor
40 virtual ~GameWindow();
42 //! GameWindow Initializer
43 bool init(ClientValues
* conf
);
46 void buttonDown(const Gosu::Button btn
);
49 void buttonUp(const Gosu::Button btn
);
55 bool needsRedraw() const;
60 //! Syncronized time value used throughout the engine
64 //! Calculate time passed since engine state was last updated
67 //! Process persistent keyboard input
68 void handleKeyboardInput();
70 boost::scoped_ptr
<Resourcer
> rc
;
71 boost::scoped_ptr
<World
> world
;
73 //! Last time engine state was updated.
76 //! Milliseconds that have passed since engine last updated.
79 //! Milliseconds that have passed since game started. Loops on overflow.
82 //! Call the garbage colelctor once a second.
86 bool consecutive
, initiallyResolved
;
90 std::map
<Gosu::Button
, keystate
> keystates
;