33 lines
716 B
C++
33 lines
716 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:
|
|
explicit ShaderProgram(GLuint id) : id(id) {}
|
|
|
|
void bind();
|
|
static void unbind();
|
|
|
|
void setFloat(std::string_view name, float value) const;
|
|
void setInt(std::string_view name, int 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
|