#pragma once
#include <mutex>

#include "misc/mirage_type.h"
#include "render/render_context.h"

class mirage_render_context;

class mirage_app {
public:
	void init();
	void run();

	static mirage_app& get() {
		static mirage_app instance;
		return instance;
	}

	[[nodiscard]] bool is_running() const {
		return running;
	}

	[[nodiscard]] duration_type get_delta_time() const {
		return delta_time;
	}

	[[nodiscard]] static mirage_render_context* get_render_context() {
		return render_context;
	}
private:
	inline static mirage_render_context* render_context{};
	time_type last_time = {};
	duration_type delta_time = {};
	std::atomic_bool running = true;
};
