added a shader class and converted existing shaders to files
This commit is contained in:
parent
3428be29ae
commit
b21b9398e6
6 changed files with 160 additions and 65 deletions
22
include/shaders/shader.hpp
Normal file
22
include/shaders/shader.hpp
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue