1 //  Construo - A wire-frame construction game
2 //  Copyright (C) 2002 Ingo Ruhnke <grumbel@gmx.de>
3 //
4 //  This program is free software: you can redistribute it and/or modify
5 //  it under the terms of the GNU General Public License as published by
6 //  the Free Software Foundation, either version 3 of the License, or
7 //  (at your option) any later version.
8 //
9 //  This program is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //  GNU General Public License for more details.
13 //
14 //  You should have received a copy of the GNU General Public License
15 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HEADER_CONSTRUO_CONSTRUO_MAIN_HPP
18 #define HEADER_CONSTRUO_CONSTRUO_MAIN_HPP
19 
20 #include <vector>
21 #include <iostream>
22 #include <list>
23 #include "config.hpp"
24 
25 class GUIManager;
26 class World;
27 class X11Display;
28 class GlutDisplay;
29 class UnixSystem;
30 
31 class ConstruoMain
32 {
33 private:
34 #ifdef USE_X11_DISPLAY
35   X11Display*  display;
36 #elif USE_GLUT_DISPLAY
37   GlutDisplay* display;
38 #endif
39   UnixSystem* system;
40 
41   bool do_quit;
42   Config config;
43   GUIManager* gui_manager;
44 public:
45   ConstruoMain ();
46   virtual ~ConstruoMain ();
47 
48   const char* get_title ();
49   int main (int argc, char* argv[]);
50 
51   /** Exit ConstruoMain and do all stuff necesarry for a clean
52       shutdown */
53   void exit();
54 private:
55   /** Called once the game is going to end, used to do the lastsave
56       and similar things */
57   void on_exit();
58 
59   /** Initialize the graphic context and the system */
60   void init_system();
61 
62   /** Shutdown the graphic display and everything else */
63   void deinit_system();
64 
65   void process_events ();
66 };
67 
68 extern ConstruoMain* construo_main;
69 
70 #endif
71 
72 /* EOF */
73