
#ifndef SPECTRE_GAME_H
#define SPECTRE_GAME_H

#include <Spectre/Graphics.h>
#include <Spectre/Input/InputEvent.h>
#include <Spectre/Game/FPSCounter.h>

class InputModule;
class MessageQueue;
class MessageHandler;
class PlatformApplication;

class Game
{
public :
	Game();
	virtual ~Game();

	void run();

	void exit();

protected :

	virtual void init() = 0;

	virtual void update(double dt) = 0;

	virtual void render() = 0;

	Graphics* getGraphics() const;

	InputModule* getInput() const;

	FPSCounter& getFpsCounter();

private :

	void setup();

	void gameLoop();

	void processEvents();

private :

	PlatformApplication *m_platform;

	Graphics *m_graphics;

	InputModule* m_input;

	MessageHandler* m_messageHandler;

	FPSCounter m_fpsCounter;

	double m_timestep;

	bool m_running;
};

#endif /* SPECTRE_GAME_H */
