Gel2D - The free/open source game creation suite

gelEngine.h
Go to the documentation of this file.
00001 /*
00002 Gel2D Game Engine - Cross-platform 2D gaming middleware
00003 Copyright (C) 2010-2011 Mark D. Procarione
00004 
00005 Gel2D is free software: you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation, either version 3 of the License, or
00008 (at your option) any later version.
00009 
00010 Gel2D is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013 GNU General Public License for more details.
00014 */
00015 
00016 #ifndef __GELENGINE_H__
00017 #define __GELENGINE_H__
00018 
00019 #include "gelNamespace.h"
00020 #include "gelTimer.h"
00021 #include "gelRenderSystem.h"
00022 
00023 namespace gel
00024 {
00026 
00032     class GelEngine
00033     {
00034         public:
00036 
00037             static void start();
00038 
00040 
00042             static int shutdown();
00043 
00045             static GelRenderSystem *getRenderSystem() { return rendersys; }
00046 
00048 
00052             static void setRenderAPI( RenderAPI api );
00053 
00055 
00057             static RenderAPI getRenderAPI() { return rendersys->getType(); }
00058 
00060 
00065             static void setFrameFunc( GelCallbackB func ) { frameFunc = func; }
00066 
00068 
00071             static void setDrawFunc( GelCallback func ) { drawFunc = func; }
00072 
00074 
00077             static void setFPS(int _fps) { fps = _fps; }
00078 
00080 
00081                         static int getFPS() { return fps; }
00082 
00084 
00085             static bool startLoop();
00086 
00088 
00090             static bool log( const char *message, ... );
00091 
00093 
00094             static void setLogFilename( const char *filename ) { logfilename = filename; }
00095 
00096         private:
00097             static bool (*frameFunc)();
00098             static void (*drawFunc)();
00099 
00100             static bool looping;
00101             static bool started;
00102 
00103             static const char *logfilename;
00104                         static bool islogfile;
00105 
00106                         static GelTimer timer;
00107                         static int fps;
00108 
00109                         static GelRenderSystem *rendersys;
00110     };
00111 }
00112 
00113 #endif // __GELENGINE_H__