33 lines
781 B
C
33 lines
781 B
C
|
|
//
|
||
|
|
// Created by lbmas on 4/29/2026.
|
||
|
|
//
|
||
|
|
|
||
|
|
#ifndef B_ENGINE_SHADERPROGRAM_H
|
||
|
|
#define B_ENGINE_SHADERPROGRAM_H
|
||
|
|
|
||
|
|
#include <memory>
|
||
|
|
#include <string_view>
|
||
|
|
|
||
|
|
#include "glad/gl.h"
|
||
|
|
|
||
|
|
#include <glm/glm.hpp>
|
||
|
|
|
||
|
|
class ShaderProgram
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
static std::shared_ptr<ShaderProgram> load(std::string_view vertexPath, std::string_view fragmentPath);
|
||
|
|
|
||
|
|
void bind();
|
||
|
|
void unbind();
|
||
|
|
|
||
|
|
void setFloat(std::string_view name, float value) const;
|
||
|
|
void setVec2(std::string_view name, const glm::vec2 &value) const;
|
||
|
|
void setVec3(std::string_view name, const glm::vec3 &value) const;
|
||
|
|
void setMat4(std::string_view name, const glm::mat4 &mat) const;
|
||
|
|
void setVec4(std::string_view name, const glm::vec4 &value) const;
|
||
|
|
private:
|
||
|
|
GLuint id = 0;
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
#endif //B_ENGINE_SHADERPROGRAM_H
|