VisualizeVideo
 All Classes Functions Pages
Program.h
1 #pragma once
2 
3 #include <GL/glew.h>
4 #include <GL/glfw.h>
5 
6 #include <vector>
7 #include <memory>
8 
9 #include <glm/glm.hpp>
10 
11 #include "Shader.h"
12 #include "RenderingException.h"
13 
15 
16 class Program
17 {
18 public:
20  Program(const std::vector<std::shared_ptr<Shader>> &shaderList) throw(RenderingException);
21  ~Program(void);
22 
24  GLuint getProgram() const;
25 
27  void use();
29  void unuse();
31  void uniform(const std::string &name, const glm::mat4 &mat);
32  void uniform(const std::string &name, GLfloat val);
33  void uniform(const std::string &name, GLint val);
34  void uniform(const std::string &name, const glm::vec3 &v);
35  void uniform(const std::string &name, const glm::vec2 &v);
36 private:
37  // Stores the list of shaders
38  std::vector<std::shared_ptr<Shader>> _shaders;
39  // Stores the OpenGL handle to the program
40  GLuint _program;
41 };
42