/*
 * Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved.
 */

#pragma once

#include <turbine/clipboard.hpp>
#include <turbine/context.hpp>
#include <turbine/gfx.hpp>
#include <turbine/turbine.hpp>

namespace turbine {

class Context {
	public:
		UpdateHandler updateHandler = [](Context&) -> int {return -1;};
		keel::Context keelCtx;
		KeyEventHandler keyEventHandler = nullptr;
		MouseButtonEventHandler mouseButtonEventHandler = nullptr;
		ox::AnyPtr applicationData;

		// GLFW impl data ////////////////////////////////////////////////////////
		TimeMs mandatoryRefreshPeriodEnd{};
		ox::UPtr<BaseClipboardObject> clipboard;
		struct GLFWwindow *window = nullptr;
		int refreshWithinMs = 0;
		ox::Vector<gl::Drawer*, 5> drawers;
		TimeMs startTime = 0;
		uint64_t wakeupTime = 0;
		uint64_t keysDown = 0;
		uint64_t prevFpsCheckTime = 0;
		uint64_t draws = 0;
		bool running{};
		ShutdownHandler shutdownHandler{};
		float scale{};

		Context() noexcept = default;

		Context(Context const &other) noexcept = delete;
		Context(Context const &&other) noexcept = delete;

};

}
