//	TitleScreen.h - The title screen.
//  ----------------------------------------------------------------------------
//	This file is part of 'NiallsAVLib', base code for any kind of audiovisual
//	apps.
//	Copyright (C) 2012  Niall Moody
//	
//	This program is free software: you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	This program is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with this program.  If not, see <http://www.gnu.org/licenses/>.
//	----------------------------------------------------------------------------

#ifndef TITLESCREEN_H_
#define TITLESCREEN_H_

#include "ThreeFloats.h"
#include "GameState.h"

///	The main gameplay state.
class TitleScreen : public GameState
{
  public:
	///	Constructor.
	TitleScreen(Application *app, Sounder *sound);
	///	Destructor.
	~TitleScreen();

	///	Draws the current state.
	void draw(DrawerPtr d);

	///	Called when a key down event is received.
	void keyDown(const std::wstring& action,
				 const std::wstring& keyPressed,
				 int keyModifier);

	///	Called when a mouse down event is received.
	void mouseDown(int button, const TwoFloats& pos);

	///	Returns the name of this state.
	const std::wstring getName() const {return L"TitleScreen";};
	///	Used to construct instances of this state.
	static GameStateCreator<TitleScreen> creator;
  private:
	///	Used to fade in from the loading screen.
	float fadeIn;
	///	Used to fade out from the loading screen.
	float fadeOut;

	///	Used to interpolate between colours.
	ThreeFloats lastCol;
	///	Used to interpolate between colours.
	ThreeFloats nextCol;
	///	Used to interpolate between colours.
	float colInterp;
};

#endif
