Gel2D - The free/open source game creation suite

gelAppBase.h
Go to the documentation of this file.
00001 /*
00002 Gel2D Game Engine - Cross-platform 2D gaming middleware
00003 Copyright (C) 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 __GELAPPBASE_H__
00017 #define __GELAPPBASE_H__
00018 
00019 #include "gelTimer.h"
00020 #include "gelEvent.h"
00021 
00022 namespace gel
00023 {
00025 
00026     class GelAppBase : public GelEventReceiver
00027     {
00028         public:
00030                         GelAppBase();
00031 
00033                         virtual ~GelAppBase();
00034 
00036 
00037                         void start();
00038 
00039                 protected:
00041 
00045                         virtual bool update();
00046 
00048 
00049                         virtual void render();
00050 
00052 
00054                         virtual void mainLoop();
00055 
00057 
00060                         void setFPS(int _fps) { fps = _fps; }
00061 
00063 
00064                         int getFPS() { return fps; }
00065 
00066                 private:
00067             bool looping;
00068             GelTimer timer;
00069                         int fps;
00070     };
00071 }
00072 
00073 #endif // __GELAPPBASE_H__