-
Notifications
You must be signed in to change notification settings - Fork 1
/
Shader.h
47 lines (43 loc) · 1.22 KB
/
Shader.h
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once
#include "Includes.h"
using std::string;
using std::ifstream;
///
/// \brief The Shader class
///
///
class Shader
{
public:
///
/// \brief Shader sets default shader values
///
Shader();
///
/// \brief Shader read vertex and fragment shaders file path then compile the shaders
/// \param vertexPath file path to the vertex shader
/// \param fragmentPath file path to the fragment shader
///
Shader(const GLchar* vertexPath, const GLchar* fragmentPath);
///
/// \brief Shader Shader read vertex and fragment shaders file path then compile the shaders as well as reading the geometry
/// \param vertexPath file path to the vertex shader
/// \param fragmentPath file path to the fragment shader
/// \param geometryPath file path to geometry shader
///
Shader(const GLchar* vertexPath, const GLchar* fragmentPath, const GLchar* geometryPath);
GLuint GetProgram() const { return program; }
///
/// \brief Create generates the shader program
///
void Create();
///
/// \brief Use uses the shader program
///
void Use() const;
private:
GLuint program;
GLuint vertexShader;
GLuint fragmentShader;
GLuint geometryShader;
};