UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
shaderprogram.h
Go to the documentation of this file.
1 #ifndef UGDK_GRAPHIC_SHADERPROGRAM_H_
2 #define UGDK_GRAPHIC_SHADERPROGRAM_H_
3 
4 #include <ugdk/graphic/opengl.h>
5 #include <ugdk/graphic.h>
6 #include <string>
7 
8 namespace ugdk {
9 namespace graphic {
10 
12  public:
13  ShaderProgram();
15 
16  GLuint id() const { return id_; }
17  GLuint UniformLocation(const std::string& name) const;
18 
19  bool IsValid() const;
20  void AttachShader(const Shader& shader);
21  bool SetupProgram();
22  void Validate();
23 
24  private:
25  void PrintLog(const std::string& title) const;
26 
27  GLuint id_;
28  GLuint matrix_location_;
29  GLuint color_location_;
30  GLuint texture_location_;
31 
32  friend class Canvas;
33  friend class ShaderUse;
34 };
35 
36 } // namespace graphic
37 } // namespace ugdk
38 
39 #endif // UGDK_GRAPHIC_SHADERPROGRAM_H_
Definition: canvas.h:28
GLuint UniformLocation(const std::string &name) const
Definition: shader.h:10
Definition: animation.h:11
friend class ShaderUse
Definition: shaderprogram.h:33
GLuint id() const
Definition: shaderprogram.h:16
Definition: shaderprogram.h:11
void AttachShader(const Shader &shader)