#ifndef __C_MAIN_WINDOW_H_INCLUDED__
#define __C_MAIN_WINDOW_H_INCLUDED__


#include <irrlicht.h>
#include "CGameContext.h"
#include "CMountain.h"
#include "CDynamicCamera.h"
//#include "RTSCamera.h"

using namespace irr;

struct SMouseState
{
    core::vector2d<s32> Position;
    bool LeftButtonDown;
    SMouseState() : LeftButtonDown(false) { }
};

class CMainWindow : public IEventReceiver
{
public:

	CMainWindow(bool fullscreen, bool music, bool shadows, bool additive, bool vsync, bool aa, video::E_DRIVER_TYPE driver,core::stringw strRes);

	~CMainWindow();

	void run();

	virtual bool OnEvent(const SEvent& event);
	void setCurrentMap(core::stringc m);

	SAppContext app;
	SMouseState & GetMouseState();
	CMountain *mountain;
    ISceneNode* SelectedNode;// the selected node
    core::dimension2d<u32> resolution;

    CArbre* SelectedArbre;
    CRemontee* SelectedRM;

private:

	void createLoadingScreen();
	void loadSceneData();
	void switchToNextScene();
	void shoot();
	void createParticleImpacts();

	bool fullscreen;
	bool music;
	bool shadows;
	bool additive;
	bool vsync;
	bool aa;
	const core::stringw resolutionStr;

	core::stringc currentmap;

	video::E_DRIVER_TYPE driverType;
	IrrlichtDevice *device;
	CGameContext *contexte;
    //CMyEventReceiver *receiver;
	scene::ISceneNode* arrow;

};

#endif
