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

#pragma once

#include <ox/std/types.hpp>

#include <glutils/glutils.hpp>

#include <nostalgia/core/gfx.hpp>
#include <nostalgia/core/context.hpp>

#include "gfx.hpp"

namespace nostalgia::core {

class Context {

	public:
		turbine::Context &turbineCtx;
		glutils::GLProgram bgShader;
		glutils::GLProgram spriteShader;
		ox::Array<renderer::CBB, 4> cbbs;
		renderer::SpriteBlockset spriteBlocks;
		ox::Array<Sprite, 128> spriteStates;
		ox::Array<GLfloat, 1024> bgPalette;
		ox::Array<renderer::Background, 4> backgrounds;
		renderer::Drawer drawer;
		uint_t spriteCount = 0;
		uint_t blocksPerSprite = 0;
		explicit Context(turbine::Context &tctx, InitParams const&params) noexcept;
		Context(Context const&) = delete;
		Context(Context&&) = delete;
		Context &operator=(Context const&) = delete;
		Context &operator=(Context&&) = delete;
		~Context() noexcept;
};

}
