Labyrinth
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
root.hpp
1 //////////////////////////////
2 //
3 // File: labyrinth/root.hpp
4 // Author: Maciej Kaminski
5 // E-mail: maciej.a.kaminski@gmail.com
6 // Website: maciejkaminski.pl
7 //
8 // File creation date: Oct 17 2013
9 // This file is part of Project Labyrinth
10 // This file is going to be released under terms of GNU GPL in near future
11 //
12 //////////////////////////////
13 
14 #ifndef __LABYRINTH_ROOT__
15 #define __LABYRINTH_ROOT__
16 #include <list>
17 #include "lxs/windowing/root.hpp"
18 #include<boost/shared_ptr.hpp>
19 
20 namespace LxS
21 {
22  namespace Game{
23  class MapWindow;
24  }
25 }
26 
27 //! product namespace
28 namespace Labyrinth
29 {
30  class Renderable;
31  class Font;
32  namespace Audio
33  {
34  class Audio;
35  }
36  //! \brief Root window of the game.
37  //! The one that containss main menu or actual
38  //! 3D view. Or progress bar.
39  class Root: public LxS::Windowing::Root
40  {
41  friend class MainMenu;
42  //! Pointer to main menu window. It is always ready to be displayed,
43  //! as game can be paused to (i.e.) save or adjust settings
44  LxS::Windowing::Window * p_MainMenu;
45  LxS::Game::MapWindow * DefaultMap;
46 
47  public:
48  //! Do I display framerate?
49  Root() {p_MainMenu=0; DefaultMap=0;}
50  virtual void Render(Rendermode mode);
51  virtual void Initialize();
52  void Animate(float dt);
53  virtual void JoystickAxes(int Axis, const float *direction);
54  virtual void UnloadResources();
55  // centimeters from bottom-left
56  //! start a game
57  void StartGame();
58  void SaveFile();
59  //! continue game (from file or from memory state)
60  void ContinueGame();
61  void MenuButtonPressed();
62  void BackButtonPressed();
63  //! reset map to start new game
64  void ResetDefaultMap();
65  ~Root();
66  };
67 }
68 
69 #endif