[r2399]: branches / terrain / src / gui / application.h Maximize Restore History

Download this file

application.h    258 lines (195 with data), 4.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
#ifndef APPLICATION_H
#define APPLICATION_H
#include "OgreTimer.h"
#include "OgreWindowEventUtilities.h"
#include "OgreLogManager.h"
#include "OgreMeshManager.h"
// needed to be able to create the CEGUI renderer interface
#include "CEGUI/RendererModules/Ogre/CEGUIOgreRenderer.h"
// CEGUI includes
#include "CEGUI/CEGUISystem.h"
#include "CEGUI/CEGUIInputEvent.h"
#include "CEGUI/CEGUIWindow.h"
#include "CEGUI/CEGUIWindowManager.h"
#include "CEGUI/CEGUISchemeManager.h"
#include "CEGUI/CEGUIFontManager.h"
#include "CEGUI/elements/CEGUIFrameWindow.h"
#include <stdio.h>
#include "mainwindow.h"
#include "timer.h"
#include "graphicmanager.h"
#ifdef __APPLE__
#include <CoreFoundation/CFBundle.h>
#endif
/**
* \class Application
* \brief Basisklasse der Anwendung
*/
class Application
{
public:
/**
* \fn Application()
* \brief Konstruktor
*/
Application(char *argv);
/**
* \fn ~Application()
* \brief Destruktor
*/
virtual ~Application();
/**
* \fn run()
* \brief Startet die Applikation
*/
void run();
/**
* \fn Document* getDocument()
* \brief Gibt einen Zeiger auf das Dokument aus
*/
Document* getDocument()
{
return m_document;
}
private:
// Funktionen
/**
* \fn init()
* \brief Initialisiert die Anwendung
*/
bool init(char *argv);
/**
* \fn initOgre()
* \brief Initialisiert die Ogre Rendering Engine
*/
bool initOgre();
/**
* \fn configureOgre()
* \brief Konfiguriert die Ogre Rendering Engine
*/
bool configureOgre();
/**
* \fn setupResources()
* \brief Stellt die Ressourcen fuer Ogre und CEGUI ein
*/
bool setupResources();
/**
* \fn initGettext()
* \brief Initialisiert Gettext
*/
bool initGettext();
/**
* \fn initCEGUI()
* \brief Initialisiert CEGUI
*/
bool initCEGUI();
/**
* \brief initialisiert OpenAL
*/
bool initOpenAL();
/**
* \fn bool createView()
* \brief Erzeugt die Ansichten
*/
bool createView();
/**
* \fn bool createDocument()
* \brief Erzeugt das Document
*/
bool createDocument();
/**
* \brief loads the ressources specified by \a datagroups
* \param datagroups bitmask consisting of members of \ref World::DataGroups
*/
bool loadResources(int datagroups=0xfffffff);
/**
* \brief clears the Ressources specified by \a datagroups
* \param datagroups bitmask consisting of members of \ref World::DataGroups
*/
void cleanup(int datagroups=0xfffffff);
/**
* \fn virtual void update()
* \brief Aktualisierungen
*/
virtual void update();
/**
* \fn void updateStartScreen(float percent)
* \brief aktualisiert den Startbildschirm
* \param percent Prozentsatz, zu dem das Laden der Daten fortgeschritten ist
*/
void updateStartScreen(float percent);
#ifdef __APPLE__
/**
* \fn Ogre::String macPath()
* \brief Returns the path to the Resources directory on mac
*/
Ogre::String macPath()
{
Ogre::String path;
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
char resPath[PATH_MAX];
CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)resPath, PATH_MAX);
CFRelease(resourcesURL);
path = resPath;
return path;
}
#endif
// Member
/**
* \var Ogre::Root *m_ogre_root
* \brief Basisobjekt der Ogre Engine
*/
Ogre::Root *m_ogre_root;
/**
* \var CEGUI::System* m_cegui_system
* \brief Basisobjekt von CEGUI
*/
CEGUI::System *m_cegui_system;
/**
* \var CEGUI::OgreRenderer* m_ogre_cegui_renderer
* \brief Objekt zum Rendern von CEGUI mittels Ogre
*/
//CEGUI::OgreRenderer *m_ogre_cegui_renderer;
/**
* \var Ogre::RenderWindow *m_window
* \brief Fenster der Applikation
*/
Ogre::RenderWindow *m_window;
/**
* \var Ogre::SceneManager *m_scene_manager
* \brief Objekt fuer das Management der Szene
*/
Ogre::SceneManager *m_scene_manager;
/**
* \var bool m_shutdown
* \brief true, wenn die Anwendung beendet werden soll
*/
bool m_shutdown;
/**
* \var Ogre::TerrainGlobalOptions *m_terrainOptions
* \brief Global terrain options
*/
Ogre::TerrainGlobalOptions *m_terrainOptions;
protected:
/**
* \var Document* m_document
* \brief Dokument, enthaelt alle Daten fuer die Darstellung
*/
Document* m_document;
/**
* \var MainWindow* m_main_window
* \brief Hauptfenster der Applikation
*/
MainWindow* m_main_window;
/**
* \var Timer m_timer
* \brief Timer fuer verschiedene Verwendungszwecke
*/
Timer m_timer;
/**
* \brief Set to true if the application has reached the run loop
*/
bool m_running;
};
#endif