VisPro  1.0
Project of Visualisierung 2
Shader.h
Go to the documentation of this file.
1 // as seen in CG Tutorial (http://cg.tuwien.ac.at/courses/CG23/videos/2015/CG_Tut_2_part4%20-%20WLAN.m4v)
2 
3 #pragma once
4 
9 #include <string>
10 #include "glew.h"
11 #include "glfw3.h"
12 #include "../Scene/PointLight.h"
13 #include <vector>
14 #include <memory>
15 
18 class Shader
19 {
20 public:
25  Shader(const std::string& vertexShader, const std::string& fragmentShader);
31  Shader(const std::string& vertexShader, const std::string& geometryShader, const std::string& fragmentShader);
32  ~Shader();
33 
36  void useShader() const;
37 
41  virtual void setLighting(std::vector<std::shared_ptr<PointLight>> *allLights);
42 
46  void setCutawayDimension(glm::vec2 dim);
47 
51  virtual void bindTexture(int unit);
52 
55  GLuint programHandle;
56 
57 private:
63  void loadShader(const std::string& shader, GLenum shaderType, GLuint& handle);
66  void link();
69  void linkWithGeometryShader();
70 
71  GLuint vertexHandle;
72  GLuint fragmentHandle;
73  GLuint geometryHandle;
74 };
virtual void bindTexture(int unit)
Definition: Shader.cpp:176
virtual void setLighting(std::vector< std::shared_ptr< PointLight >> *allLights)
Definition: Shader.cpp:162
GLuint programHandle
Definition: Shader.h:55
void setCutawayDimension(glm::vec2 dim)
Definition: Shader.cpp:166
Definition: Shader.h:18
void useShader() const
Definition: Shader.cpp:60
Shader(const std::string &vertexShader, const std::string &fragmentShader)
Definition: Shader.cpp:12