Files
Modularity/include/Shaders/Shader.h
Anemunt 9adb1ff2f5 [Improve file explorer & implement Assimp with lighting/material support]
- Reworked file explorer UI for clearer hierarchy and usability
- Actually wired up Assimp properly for model loading
- Added basic lighting support
- Added independent material support per mesh
(oh my gosh this took 4 days to actually get working, let alone not crashing 😭)
2025-12-09 03:09:37 -05:00

30 lines
841 B
C++

#ifndef SHADER_H
#define SHADER_H
#include <string>
#include "../../ThirdParty/glm/glm.hpp"
class Shader
{
public:
unsigned int ID;
Shader(const char* vertexPath, const char* fragmentPath);
void use();
void setBool(const std::string &name, bool value) const;
void setInt(const std::string &name, int value) const;
void setFloat(const std::string &name, float value) const;
void setVec2(const std::string &name, const glm::vec2 &value) const;
void setVec3(const std::string &name, const glm::vec3 &value) const;
void setMat4(const std::string &name, const glm::mat4 &mat) const;
private:
std::string readShaderFile(const char* filePath);
void compileShaders(const char* vertexSource, const char* fragmentSource);
void checkCompileErrors(unsigned int shader, std::string type);
};
#endif