-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshader.h
More file actions
31 lines (27 loc) · 1.03 KB
/
Copy pathshader.h
File metadata and controls
31 lines (27 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef SHADER_H
#define SHADER_H
#include <string>
#include <fstream>
#include <sstream>
#include<iostream>
#include <glm/glm.hpp>
class Shader{
public:
// the program ID
unsigned int ID;
// Constructor reads and builds the shader
Shader(const char* vertexPath, const char* fragmentPath);
// Constructor with geometry shader
Shader(const char* vertexPath, const char* fragmentPath, const char* geometryPath);
// use/activate the shader
void use();
// utility uniforms functions
void setBool(const std::string &name, bool value) const;
void setInt(const std::string &name, int value) const;
void setVec3(const std::string &name, glm::vec3 value) const;
void setVec4(const std::string &name, glm::vec4 value) const;
void setFloat(const std::string &name, float value) const;
void setMat3(const std::string &name, const glm::mat3 value) const;
void setMat4(const std::string &name, const glm::mat4 value) const;
};
#endif