engine.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005-2008 by the FIFE team                              *
00003  *   http://www.fifengine.de                                               *
00004  *   This file is part of FIFE.                                            *
00005  *                                                                         *
00006  *   FIFE is free software; you can redistribute it and/or                 *
00007  *   modify it under the terms of the GNU Lesser General Public            *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2.1 of the License, or (at your option) any later version.    *
00010  *                                                                         *
00011  *   This library is distributed in the hope that it will be useful,       *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014  *   Lesser General Public License for more details.                       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with this library; if not, write to the                 *
00018  *   Free Software Foundation, Inc.,                                       *
00019  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
00020  ***************************************************************************/
00021 
00022 #ifndef FIFE_ENGINE_H
00023 #define FIFE_ENGINE_H
00024 
00025 // Standard C++ library includes
00026 #include <map>
00027 #include <string>
00028 #include <vector>
00029 
00030 // Platform specific includes
00031 #ifdef USE_COCOA
00032 #include <objc/runtime.h>
00033 #endif
00034 
00035 // 3rd party library includes
00036 #include <SDL.h>
00037 
00038 // FIFE includes
00039 // These includes are split up in two parts, separated by one empty line
00040 // First block: files included from the FIFE root src directory
00041 // Second block: files included from the same folder
00042 #include "enginesettings.h"
00043 
00044 namespace gcn {
00045     class Graphics;
00046 }
00047 
00048 namespace FIFE {
00049 
00050     class SoundManager;
00051     class RenderBackend;
00052     class GUIManager;
00053     class VFS;
00054     class VFSSourceFactory;
00055     class EventManager;
00056     class TimeManager;
00057     class ImagePool;
00058     class AnimationPool;
00059     class Model;
00060     class LogManager;
00061     class GuiFont;
00062     class Cursor;
00063     class SoundClipPool;
00064     class RendererBase;
00065 
00066 
00073     class Engine {
00074     public:
00077         Engine();
00078 
00081         virtual ~Engine();
00082 
00085         EngineSettings& getSettings();
00086         
00089         void init();
00090 
00093         void destroy();
00094         
00098         void initializePumping();
00099         
00104         void finalizePumping();
00105 
00108         void pump();
00109 
00112         SoundManager* getSoundManager() const { return m_soundmanager; }
00113         
00116         EventManager* getEventManager() const { return m_eventmanager; }
00117         
00120         TimeManager* getTimeManager() const { return m_timemanager; }
00121         
00124         GUIManager* getGuiManager() const { return m_guimanager; }
00125         
00128         ImagePool* getImagePool() const { return m_imagepool; }
00129         
00132         AnimationPool* getAnimationPool() const { return m_animpool; }
00133 
00136         SoundClipPool* getSoundClipPool() const { return m_soundclippool; }
00137         
00140         RenderBackend* getRenderBackend() const { return m_renderbackend; }
00141         
00144         Model* getModel() const { return m_model; }
00145         
00148         LogManager* getLogManager() const { return m_logmanager; }
00149         
00152         GuiFont* getDefaultFont() const { return m_defaultfont; }
00153         
00156         VFS* getVFS() const { return m_vfs; }
00157         
00160         Cursor* getCursor() const { return m_cursor; }
00161 
00162     private:
00163         void preInit();
00164         
00165         RenderBackend* m_renderbackend;
00166         GUIManager* m_guimanager;
00167         EventManager* m_eventmanager;
00168         SoundManager* m_soundmanager;
00169         TimeManager* m_timemanager;
00170         ImagePool* m_imagepool;
00171         AnimationPool* m_animpool;
00172         SoundClipPool* m_soundclippool;
00173         VFS* m_vfs;
00174         Model* m_model;
00175         gcn::Graphics* m_gui_graphics;
00176         LogManager* m_logmanager;
00177         GuiFont* m_defaultfont;
00178         Cursor* m_cursor;
00179         bool m_destroyed;
00180         
00181         EngineSettings m_settings;
00182 
00183         std::vector<RendererBase*> m_renderers;
00184 
00185 #ifdef USE_COCOA
00186         objc_object *m_autoreleasePool;
00187 #endif
00188 
00189     };
00190 
00191 }//FIFE
00192 
00193 #endif
Generated by  doxygen 1.6.2-20100208