#define WIN32_LEAN_AND_MEAN
#include <Windows.h>

#include "game/game_app.h"

void StartUp()
{
	g_gameApp = new GameApp();
	g_gameApp->Init();
}

void Shutdown()
{
	g_gameApp->Shutdown();
	delete g_gameApp;
	g_gameApp = nullptr;
}

void Frame()
{
	MSG msg = {};
	while (msg.message != WM_QUIT && !g_gameApp->IsExitRequested())
	{
		if (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
		{
			TranslateMessage(&msg);
			DispatchMessageA(&msg);
		}
		else
		{
			g_gameApp->UpdateFrame();
		}
	}
}

int main(int argc, char* argv[])
{
	StartUp();

	Frame();

	Shutdown();

	return 0;
}