GraphicsInteractionManager.h

Go to the documentation of this file.
00001 /*
00002  * GraphicsInteractionManager.h
00003  *
00004  *  Created on: Dec 20, 2011
00005  *      Author: sushil
00006  */
00007 
00008 
00009 #ifndef GRAPHICSINTERACTIONMANAGER_H_
00010 #define GRAPHICSINTERACTIONMANAGER_H_
00011 
00012 
00013 #include <map>
00014 
00015 #include <OgreCamera.h>
00016 
00017 #include <OgreRoot.h>
00018 #include <OgreViewport.h>
00019 #include <OgreSceneManager.h>
00020 #include <OgreRenderWindow.h>
00021 #include <OgreConfigFile.h>
00022 #include <OgreSceneNode.h>
00023 
00024 #include <OgreFrameListener.h>
00025 #include <OgreWindowEventUtilities.h>
00026 
00027 #include <gfxNode.h>
00028 #include <const.h>
00029 #include <uiMgr.h>
00030 #include <widgetMgr.h>
00031 #include <gfxConst.h>
00032 
00033 #include <lobbyMgr.h>
00034 #include <OgreParticleSystem.h>
00035 #include <OgreParticleEmitter.h>
00036 
00037 extern const int FastEcslent::MaxEnts;
00038 
00039 namespace OgreGFX {
00040 
00041         class Engine;
00042         class GraphicsInteractionManager : public Ogre::FrameListener, public Ogre::WindowEventListener {
00043         public:
00044                 GraphicsInteractionManager(FastEcslent::Engine* eng);
00045                 ~GraphicsInteractionManager(void);
00046 
00047                 void go(void);
00048                 FastEcslent::Engine* engine;
00049                 UIMgr*  uiMgr;
00050                 WidgetMgr* widgetMgr;
00051                 LobbyMgr *lobbyMgr;
00052 
00053                 Ogre::Root *mRoot;
00054                 Ogre::SceneManager* mSceneMgr;
00055                 Ogre::RenderWindow* mWindow;
00056                 Ogre::Camera* mCamera;
00057 
00058                 GFXNode          gfxNodes[FastEcslent::MaxEnts];
00059                 std::map<Ogre::SceneNode*, int> sceneNodeToEntIdMap;
00060                 int              nGFXNodes;
00061 
00062                 Ogre::Plane oceanSurface;
00063 
00064                 void loadGameGFX(void);
00065 
00066                 // Ogre::FrameListener
00067                 bool frameRenderingQueued(const Ogre::FrameEvent& evt);
00068                 // Ogre::WindowEventListener
00069                 //Adjust mouse clipping area
00070                 void windowResized(Ogre::RenderWindow* rw);
00071                 //Unattach OIS before window shutdown (very important under Linux)
00072                 void windowClosed(Ogre::RenderWindow* rw);
00073 
00074                 void makeNode(FastEcslent::Entity *);
00075 
00076         private:
00077                 void initGFXManagers();
00078                 bool configure(void);
00079                 void chooseSceneManager(void);
00080                 void createCamera(void);
00081 
00082                 void createUIMgr(void);
00083                 void createWidgetMgr(void);
00084 
00085                 void createScene(void);// = 0; // Override me!
00086                 void destroyScene(void);
00087                 void createViewports(void);
00088                 void setupResources(void);
00089                 void createResourceListener(void);
00090                 void loadResources(void);
00091 
00092                 bool setup();
00093                 bool setupGame();
00094                 void createLobbyMgr(void);
00095                 void loadLobbyGFX(void);
00096 
00097                 //Simulation bridge
00098                 void makeInitialEntityNodes();
00099 
00100                 void handleDevelopingEnts();
00101                 void handleBornEnts();
00102                 void copySimState();
00103 
00104                 /*
00105                  * Trigger explosion on a certain unit
00106                  * @param node, entity node where explosion show
00107                  */
00108                 void explode(Ogre::SceneNode *node);
00109                 /*
00110                  * Create explosion particle system
00111                  */
00112                 void createPaticleSystem();
00113 
00114                 Ogre::String mResourcesCfg;
00115                 Ogre::String mPluginsCfg;
00116 
00117                 bool mCursorWasVisible;                    // was cursor visible before dialog appeared
00118                 bool mShutDown;
00119 
00120                 //particle system for explosion
00121                 Ogre::ParticleSystem *explosionParticleSystem;
00122         };
00123 
00124 }
00125 
00126 #endif /* GRAPHICSINTERACTIONMANAGER_H_ */

Generated on Fri Dec 13 14:54:16 2013 for FastECSLent by  doxygen 1.5.4