hx3d  1
2D/3D Simple Game Framework
core.hpp
1 /*
2  Centralized framework management.
3  Copyright (C) 2015 Denis BOURGE
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
18  USA
19 */
20 
21 #ifndef HX3D_CORE_CORE
22 #define HX3D_CORE_CORE
23 
27 namespace hx3d {
28 
29 class AssetManager;
30 
31 namespace window {
32  class Application;
33  class Game;
34  class EventManager;
35 }
36 
37 namespace audio {
38  class AudioDevice;
39 }
40 
41 namespace net {
42  class Net;
43 }
44 
50 class Core {
51 
52 public:
53 
57  enum class SystemType {
59  Android,
61  iOS,
63  Linux,
65  Windows,
67  MacOS,
69  Unknown
70  };
71 
77  static window::Application* App();
78 
84  static window::Game* CurrentGame();
85 
91  static AssetManager* Assets();
92 
98  static window::EventManager* Events();
99 
105  static net::Net* Network();
106 
112  static audio::AudioDevice* Audio();
113 
120  static void initialize(window::Application* app, window::EventManager* events);
121 
127  static void setGame(window::Game* game);
128 
132  static void shutdown();
133 
136 
137  friend class Application;
138 
139 private:
140  Core();
141  ~Core();
142 
148  static Core* get();
149 
151  static Core* _instance;
152 
154  window::Application* _application;
156  window::Game* _game;
158  AssetManager* _assets;
160  window::EventManager* _events;
162  net::Net* _net;
164  audio::AudioDevice* _audio;
165 };
166 
167 } /* hx3d */
168 
169 #endif
Audio device management.
Definition: audio.hpp:40
Game main class: multiple screens management.
Definition: game.hpp:42
Network management.
Definition: net.hpp:34
Manage real-time inputs.
Application management.
Definition: application.hpp:42
hx3d framework namespace
Definition: audio.hpp:26
static SystemType CurrentSystem
Current system type.
Definition: core.hpp:135
SystemType
System types.
Definition: core.hpp:57
Centralized framework management.
Definition: core.hpp:50
Asset management.
Definition: assets.hpp:36