#include <Ogre.h>
#include <OIS/OIS.h>
#include <OgreConfigFile.h>
#include <OgreException.h>
#include "PFrameListener.h"

using namespace Ogre;

class Application {

	public:
		Application();
		~Application();

		bool go();

  
	private:
		Root *				m_Root;
		FrameListener *		m_PFrameListener;
		SceneManager *		m_SceneManager;
		Camera *			m_Camera;
		RenderWindow *		m_RenderWindow;
		Ogre::String		m_resourcePath;
		Overlay	*			m_Overlay;
		Overlay	*			m_OverlayTimer;
		
		Navicella *			m_Navi;
		ExtendedCamera *	m_ExCamera;

		SceneNode *			m_Stargate;
		SceneNode *			m_StarMeshNode;

		bool				m_MissionObjects[24];
		bool				m_ShowGUI;


		//AnimationState per l'animazione finale
		AnimationState *	m_AnimationState;

		static const unsigned int MOVABLE_OBJECT = 0x00000001;
		static const unsigned int MISSION_OBJECT = 0x00000002;

		static const unsigned int TURBO_MALUS = 0x00000003;
		static const unsigned int SLOWMOTION_MALUS = 0x00000004;
		static const unsigned int PIG_MALUS = 0x00000005;
		static const unsigned int INVERTED_MALUS = 0x00000006;
		static const unsigned int INVISIBLE_MALUS = 0x00000007;

		bool setupRenderSystem();
		void createRoot();
		void defineResources();    
		void initializeResourceGroups();
		void setupScene();
		void createFrameListener();

		void startRenderLoop();
};
