BMC Engine v1.0.0
An open-source game engine powered by C and C++
Loading...
Searching...
No Matches
Shader.h
1#ifndef SHADER_H
2#define SHADER_H
3
4#include <glad/glad.h>
5
6#include <string>
7#include <fstream>
8#include <sstream>
9#include <iostream>
10
11#include "glm/glm.hpp"
12#include "glm/gtc/matrix_transform.hpp"
13#include "glm/gtc/type_ptr.hpp"
14
15#include "../../files/FileReader.h"
16
20class Shader
21{
22public:
26 GLuint ID;
27
31 Shader(const char* vertexPath, const char* fragmentPath);
32
36 void use();
37
43 void setBool(const std::string& name, bool value) const;
44
50 void setInt(const std::string& name, int value) const;
51
57 void setFloat(const std::string& name, float value) const;
58
64 void setMat4(const std::string& name, glm::mat4 value) const;
65
71 void setVec3(const std::string& name, glm::vec3 value) const;
72
78 void setVec4(const std::string& name, glm::vec4 value) const;
79
87 void vertexAttribPointer(int index, int length, int type, int totalSize);
88
89private:
90 int sizeofMultiplier = 0;
91};
92
93#endif // SHADER_H
Definition Shader.h:21
Shader(const char *vertexPath, const char *fragmentPath)
Definition Shader.cpp:3
GLuint ID
Definition Shader.h:26
void use()
Definition Shader.cpp:58
void setBool(const std::string &name, bool value) const
Definition Shader.cpp:63
void setVec3(const std::string &name, glm::vec3 value) const
Definition Shader.cpp:83
void vertexAttribPointer(int index, int length, int type, int totalSize)
Definition Shader.cpp:93
void setInt(const std::string &name, int value) const
Definition Shader.cpp:68
void setMat4(const std::string &name, glm::mat4 value) const
Definition Shader.cpp:78
void setVec4(const std::string &name, glm::vec4 value) const
Definition Shader.cpp:88
void setFloat(const std::string &name, float value) const
Definition Shader.cpp:73