#ifndef RENDER_SWITCHER_H
#define RENDER_SWITCHER_H


#include "./softProj/MainWindow.h"

#include "./softProj/gameApp/ModelViewerApp.h"
#include "./softProj/gameApp/MapViewerApp.h"
#include "./softProj/gameApp/PlanetViewerApp.h"
#include "console/InputRegister.h"
#include "softProj/Render/oglSharedData.h"


///Switchs active render logic between PlanetViewerApp, ModelViewerApp and MapViewerApp.
class RenderSwitcher : public QObject
{
	Q_OBJECT

private:
	ModelViewerApp *modelViewerApp;
	MapViewerApp *mapViewerApp;
	PlanetViewerApp *planetViewerApp;
	MainWindow &mainWindow;

	bool modelViewerActive;
	bool mapViewerActive;
	bool planetViewerActive;

	OpenGlSharedData *sharedData;
	Environment environment;

public:
	RenderSwitcher( MainWindow &mainWindow, int argc, char **argv, Environment &environment );
	~RenderSwitcher();

	ModelViewerApp* getModelViewerApp();
	MapViewerApp* getMapViewerApp();
	PlanetViewerApp* getPlanetViewerApp();
		
	void render(void);			/**<render active application - one of PlanetViewerApp, ModelViewerApp or MapViewerApp.*/
	void simulate( float dt );	/**<simulates PlanetViewerApp, ModelViewerApp and MapViewerApp. */

public slots:

	void activateMapViewerSlot(void);
	void activateModelViewerSlot(void);
	void activatePlanetViewerSlot(void);
};

#endif