//
// Created by sebastian on 06.08.26.
//

#ifndef COLORRACE_GUIRENDERER_H
#define COLORRACE_GUIRENDERER_H
#include <memory>

#include "loader/models/SimpleTexturedMesh.h"
#include "primitives/QuadFactory.h"
#include "shader/GuiShader.h"
#include "ui/GUITexture.h"
#include "utils/openglWrapper/GLRenderState.h"


namespace engine::renderer {
    class GuiRenderer {
    public:
        GuiRenderer() : m_shader(std::make_unique<shader::GuiShader>()) {
            m_renderState.depthTesting = false;
            m_renderState.depthWriting = false;
            m_renderState.alphaBlending = true;
            m_renderState.backfaceCulling = false;
            m_renderState.frontFaceCulling = false;

            m_fullscreenQuad = engine::QuadFactory::createFullScreenQuad();
        }
        void render(const std::vector<GUITexture> &guiElements) const;
    private:
        std::shared_ptr<SimpleTexturedMesh> m_fullscreenQuad;
        std::unique_ptr<shader::GuiShader> m_shader;
        GLRenderState m_renderState;
    };
}

#endif //COLORRACE_GUIRENDERER_H
