added a shader class and converted existing shaders to files

This commit is contained in:
Lukian 2025-01-28 14:39:18 +01:00
parent 3428be29ae
commit b21b9398e6
6 changed files with 160 additions and 65 deletions

View file

@ -0,0 +1,22 @@
#ifndef SHADER_H
#define SHADER_H
#include <string>
class Shader
{
public:
// the program ID
unsigned int ID;
// constructor reads and builds the shader
Shader(const char* vertexPath, const char* fragmentPath);
// use/activate the shader
void use();
// utility uniform functions
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;
};
#endif