Shader Class
This commit is contained in:
parent
15cc550bf9
commit
c085fdbf5a
5 changed files with 144 additions and 64 deletions
22
headers/shader.hpp
Normal file
22
headers/shader.hpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef SHADER_H
|
||||
#define SHADER_H
|
||||
#include <glad/glad.h>
|
||||
#include <string>
|
||||
|
||||
class Shader {
|
||||
public:
|
||||
Shader(const char *vertexPath, const char *fragmentPath);
|
||||
~Shader();
|
||||
void use();
|
||||
void setInt(const std::string &name, int value);
|
||||
void setFloat(const std::string &name, float value);
|
||||
|
||||
private:
|
||||
unsigned int ID;
|
||||
unsigned int shaderCMPL(GLenum type, const char *src);
|
||||
void shaderERR(unsigned int shader);
|
||||
unsigned int shaderProgramCMPL(const char *vertexSource,
|
||||
const char *fragmentSource);
|
||||
void shaderProgramERR(unsigned int shaderProgram);
|
||||
};
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue