Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

IApplication.h

00001 
00002 #ifndef __IAPPLICATION_H_
00003 #define __IAPPLICATION_H_
00004 /*
00005 Peon - Win32 Games Programming Library
00006 Copyright (C) 2002-2005 Erik Yuzwa
00007 
00008 This library is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU Library General Public
00010 License as published by the Free Software Foundation; either
00011 version 2 of the License, or (at your option) any later version.
00012 
00013 This library is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 Library General Public License for more details.
00017 
00018 You should have received a copy of the GNU Library General Public
00019 License along with this library; if not, write to the Free
00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 
00022 Erik Yuzwa
00023 peon AT wazooinc DOT com
00024 */
00025 
00026 #include "IApplicationState.h"
00027 
00028 namespace peon
00029 {
00036         class PEONMAIN_API IApplication 
00037         {
00038         protected:
00040                 std::map<int, IApplicationState*> m_oStates;
00041 
00043                 IApplicationState*      m_pCurrentState;
00044 
00045         public:
00049                 IApplication();
00050 
00054                 virtual ~IApplication();
00055 
00062                 virtual bool onLoadWorld() = 0;
00063 
00071                 virtual void onUnloadWorld() = 0;
00072 
00077                 virtual void onRenderWorld(){}
00078 
00085                 virtual void onUpdateWorld( float fElapsedTime ) = 0;
00086 
00095                 bool loadState( int key, IApplicationState* pState );
00096 
00100                 void unloadStates();
00101         
00107                 IApplicationState* getCurrentState(){ return m_pCurrentState; }
00108                 
00113                 void setCurrentState(int key);
00114 
00120                 virtual void onKeyEvent( SDL_KeyboardEvent* pEvent ){}
00121 
00127                 virtual void onMouseEvent( SDL_Event* pEvent ){}
00128 
00129         };
00130 }
00131 
00132 #endif
00133 

Generated on Thu Dec 1 01:55:40 2005 for Peon by  doxygen 1.4.1