#ifdef _WIN32

#include "entry_windows.h"

// ::Entry::Windows::ThirdParty::Include::

#include "xxhash/xxhash.c"
#include "fastlz/fastlz.c"

#include "platform/platform.c"
#include "util.c"
#include "assets.c"
#include "ds.c"
#include "allocators.c"
#include "renderer.c"
#include "game.c"

int CALLBACK WinMain(HINSTANCE instance, HINSTANCE prev_instance, LPSTR cmd_line, int show_code)
{
	win32_instance = instance;

#ifdef BUILD_DEBUG
	{
		AllocConsole();
	}
#endif

#ifdef BUILD_TEST
	{
		RunTests();

		return 0;
	}
#endif

	Arena *arena = ArenaCreateDebug(MB(32), __LINE__);

	Assert(pWindowInit(WINDOW_NAME), "Failed to initialize window");

	pGameInput *inputs = MakeArray(arena, pGameInput, 10);
	u32 i_count = 0;

	gGameCtx ctx = {0};
	
	gInit(&ctx);

	while (!global_quit)
	{
		pWindowEventsGet();
		gRunCycle(&ctx, inputs, i_count);
	}

	gDestroy();
}

#endif // _WIN32
