#pragma once

namespace Gos2 {

class App : public GosApp
{
	static GosApp		*pGosApp;

public:
	static int			s_frameNo;
	static _int64		s_lastTime;
	static int			s_lastFrameNo;
	static int			s_lastPolyCount;


	virtual bool		Initialize(_TCHAR *pCommandLine) = 0;	// Initialize the application's state, true == continue
	static  void		Body();				// Default body which then calls MsgLoop
	static  bool		MsgLoop();			// Handles window messages
	virtual bool		Step() = 0;			// Move the scene forward one frame, true == continue
	virtual void		Render() = 0;		// Render a single frame
	virtual void		Shutdown() =0;		// Called at game shutdown time
	virtual TCHAR *		Name()=0;			// Name of the game
	static GosApp *		CurrentApp();

	static				RegisterApp( GosApp *pNewApp );
	static void			Terminate();
	static DWORD		GetStatus();		// (DWORD)  Bit 0 is true when the app is active, Bit 1 is true when the app has keyboard focus
	static bool			RunMainLoop( void(__stdcall *DoGameLogic)() );
	static bool			InternalRunLogic( void(__stdcall *DoGameLogic)() );
};

} using namespace Gos2;