#include <engine.h>

struct {
	int width;
	int height;
}	context;

int main(void) {
	context.height = 600;
	context.width = 800;
	Vector2 position = (Vector2){0, 0};
	Camera2D cam = {0};

	InitWindow(context.width, context.height, "Game");

	SetTargetFPS(120);
	while (!WindowShouldClose()) {
		float delta = GetFrameTime();
		process_input(&input);
		update_player_movement(&localPlayer, &input, delta);
		apply_ground_snap(&localPlayer);
		
		send_player_state(&localPlayerNet);
		receive_remote_players(remotePlayers, &remoteCount);

		begin_drawing_frame();
		draw_world();
		draw_player(&localPlayer);
		draw_remote_players(remotePlayers, remoteCount);
		draw_gui();
		end_drawing_frame();
	}

	CloseWindow();
	return (0);
}
