//
// Created by sebastian on 11.02.26.
//

#ifndef DICEWARS_SIEDLER_TEXTRENDERER_H
#define DICEWARS_SIEDLER_TEXTRENDERER_H
#include <memory>

#include "../core/gui/uiComponent/UiText.h"
#include "loader/Loader.h"
#include "model/RawModel.h"
#include "model/TextQuadModel.h"
#include "shaders/TextShader.h"


class TextRenderer {
public:
    TextRenderer() : textModel(Loader::instance().loadTextModel()) {};
    void renderTexts(const std::vector<UiText *> &textsToRender);

    void renderText(const UiText &textToRender);

    void renderText(const UiText &textToRender) const;
private:
    TextShader shader;
    TextQuadModel textModel;
    static glm::mat4 calculateOrthographicProjectionMatrix();
};


#endif //DICEWARS_SIEDLER_TEXTRENDERER_H