#pragma once
#include <cfloat>

#include "pipeline.h"
#include <ft2build.h>
#include FT_FREETYPE_H
#include <omp.h>

class renderer_texture_array;
class renderer_texture;

class sdf_text_pipeline : public pipeline {
public:
    struct param {
        Eigen::Matrix4f projection_matrix;
    }; // b0
    struct sdf_font_param {
        float smoothing;
        float thickness;
        float outline_width;
        linear_color outline_color;
    }; // b1
    bool init() override;
    void destroy() override;

    virtual void set_param(const param& in_param);
    virtual void set_sdf_font_param(const sdf_font_param& in_param);
    virtual void set_glyph_texture(renderer_texture_array* in_texture) {
        glyph_texture = in_texture;
    }
protected:
    renderer_buffer* param_buffer = nullptr;
    renderer_buffer* sdf_font_param_buffer = nullptr;
    renderer_texture_array* glyph_texture = nullptr;
};
