-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglprogram.h
More file actions
39 lines (28 loc) · 910 Bytes
/
glprogram.h
File metadata and controls
39 lines (28 loc) · 910 Bytes
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
#ifndef GLPROGRAM_H
#define GLPROGRAM_H
////////////////////////////////////////////////////////////////////////////////
#include <stdint.h>
#include <string>
////////////////////////////////////////////////////////////////////////////////
/**
* @brief The GLProgram class is used to compile opengl shaders and a program.
*/
class GLProgram
{
public:
GLProgram( const char* const vertPath, const char* const fragPath );
~GLProgram();
void Use();
private:
void CompileShaders();
template< int SHADER_TYPE >
uint32_t CompileShader( const char* const path );
std::string ReadFile( const char* const path );
uint32_t CompileProgram( uint32_t vertProgramId, uint32_t fragProgramId );
private:
const char* const m_vertPath;
const char* const m_fragPath;
uint32_t m_programId;
};
////////////////////////////////////////////////////////////////////////////////
#endif // OPENGLPROGRAM_H