#pragma once

#include "managedObject.hpp"
#include "shaderPatcher.hpp"

#include <psp2/gxm.h>
#include <string>
#include <vector>

namespace render::kernel
{

class FragmentShader : public ManagedObject
{
private:
    SceGxmShaderPatcherId id;
    const SceGxmProgram *program;
    SceGxmFragmentProgram *fProgram;
    const ShaderPatcher *patcher;

public:

    FragmentShader(const char *path, ShaderPatcher *patcher);
    virtual ~FragmentShader();

    void Bind(SceGxmContext *ctx);

    const SceGxmProgramParameter *GetParam(const char *name);

    unsigned int GetParamIndex(const char *name);
    void SetDefaultUniform(SceGxmContext *context, const SceGxmProgramParameter *param, unsigned int count, const float *data);
};

} // namespace render::kernel