SuperimposeMesh
All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
Shader.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2019 Istituto Italiano di Tecnologia (IIT)
3  *
4  * This software may be modified and distributed under the terms of the
5  * BSD 3-Clause license. See the accompanying LICENSE file for details.
6  */
7 
8 #ifndef SHADER_H
9 #define SHADER_H
10 
11 #include <exception>
12 #include <string>
13 
14 #include <GL/glew.h>
15 
16 
17 class Shader
18 {
19 public:
20  /**
21  * Create a shader program with given vertex and fragment shader paths.
22  */
23  Shader(const std::string& vertex_shader_path, const std::string& fragment_shader_path);
24 
25  /**
26  * Activate the shader program.
27  */
28  void install();
29 
30  /**
31  * Deactivate the shader program.
32  */
33  void uninstall();
34 
35 
36  inline const GLuint get_program()
37  {
38  return shader_program_id_;
39  }
40 
41 private:
42  /**
43  * The program ID.
44  */
46 };
47 
48 #endif /* SHADER_H */
void install()
Activate the shader program.
Definition: Shader.cpp:129
Definition: Shader.h:17
Shader(const std::string &vertex_shader_path, const std::string &fragment_shader_path)
Create a shader program with given vertex and fragment shader paths.
Definition: Shader.cpp:18
GLuint shader_program_id_
The program ID.
Definition: Shader.h:45
const GLuint get_program()
Definition: Shader.h:36
void uninstall()
Deactivate the shader program.
Definition: Shader.cpp:135