Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members

GameState.hpp

Go to the documentation of this file.
00001 // Copyright (c) 2007-2008 Tomer Nosrati
00002 // This file is part of the "NUSoftware Game Engine".
00003 // For conditions of distribution and use, see copyright notice in nge.hpp
00004 
00005 #pragma once
00006 #ifndef __GAME_STATE_H__
00007 #define __GAME_STATE_H__
00008 
00009 #include "GameManager.hpp"
00010 #include "CursorController.hpp"
00011 #include "Level.hpp"
00012 
00013 namespace nge
00014 {
00015         namespace core
00016         {
00017 
00018                 // Forward declaration
00019                 class GameManager;
00020 
00022 
00109                 class GameState
00110                 {
00111                 public:
00113                         virtual void Init(GameManager* pManager) = 0;
00114 
00116                         virtual void Update(GameManager* pManager) = 0;
00117 
00119                         virtual void Clear(GameManager* pManager) = 0;
00120 
00122                         virtual void OnEvent(GameManager* pManager) = 0;
00123 
00125                         virtual ~GameState();
00126 
00127                 protected:
00129                         GameState();
00130 
00132 
00145                         void ChangeLevel(GameManager* pManager, Level* pLevel);
00146 
00148                         void ChangeState(GameManager* pManager, GameState* pState);
00149 
00153 
00158                         void fadeIn(GameManager* pManager, u32 time = 1500, SColor backColor = SColor(255,0,0,0));
00159 
00162 
00167                         void fadeOut(GameManager* pManager, u32 time = 1500, SColor backColor = SColor(255,0,0,0));
00168 
00170 
00175 
00176                         IGUIImage* addScaledByScreenImage(GameManager* pManager, c8 *ImageFile);
00177 
00179 
00185 
00186                         IGUIImage* addScaledImage(GameManager* pManager, c8 *ImageFile, dimension2di const& dimension);
00187 
00188                         // a name of a loaded texture will return That loaded texture
00189                         ITexture* addScaledTexture(IVideoDriver* driver, ITexture* SrcTexture, dimension2di destSize, stringc name);
00190 
00191                         bool drawMiniLogo(GameManager* pManager, c8 *LogoFile, bool drawScaled = false, dimension2di scaleBy = dimension2di(96,64));
00192 
00193                         void drawFPS(GameManager* pManager, s32 i_font = -1, SColor const& color = SColor(185,0,0,0));
00194 
00195                         IGUIInOutFader* m_pInOutFader;
00196                         NGEReceiver* m_pEventReceiver;
00197                         Level* m_pActiveLevel;
00198                 };
00199 
00200         } // namespace core
00201 } // namespace nge
00202 
00203 #endif // __GAME_STATE_H__

The NUSoftware Game Engine
The NUSoftware Game Engine Documentation © 2007-2008 by Tomer Nosrati. Generated on Sat Apr 26 16:52:34 2008 by Doxygen (1.5.5)