- 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 😭)
30 lines
841 B
C++
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
|