#ifdef __linux__

#include "entry_linux.h"

// ::ThirdParty::Include::
#include "xxhash/xxhash.c"
#include "fastlz/fastlz.c"

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

int main(int argc, char **argv) 
{
	u8 *mem = (u8 *)MemAllocZeroed(MB(64));
	Arena *arena = CreateArenaDebug(mem, MB(64), __LINE__);

	isize renderer_mem_size = MB(16);
	isize game_mem_size = MB(16);

	rawptr renderer_mem = ArenaAlloc(arena, renderer_mem_size);
	Arena *renderer_arena = CreateArenaDebug(renderer_mem, renderer_mem_size, 2);

	rawptr game_mem = ArenaAlloc(arena, game_mem_size);
	Arena *game_arena = CreateArenaDebug(game_mem, game_mem_size, 3);

  Assert(CreatePlatformWindow(WINDOW_NAME), "Failed to initialize the window");

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

	WaitForWindowEvent(inputs);

	GameContext ctx = {};

	InitializeGame(renderer_arena, &ctx, game_arena);

	while (!global_quit)
	{
		GetWindowEvents(inputs, &i_count);
		RunCycle(&ctx, inputs, i_count);
	}

	DestroyGame();
}

#endif // __linux__
