All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
VertexColoredShader.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Shader.h"
6 #include "IdTypes.h"
7 #include "VectorMathDecl.h"
8 #include "Graphics.h"
9 #include <string>
10 
11 namespace Eegeo
12 {
13  namespace Rendering
14  {
15  namespace Shaders
16  {
17  class VertexColoredShader : public Shader
18  {
19  public:
20  static VertexColoredShader* Create(const TShaderId shaderId);
21 
22  void SetMVP(const m44& mvp) const
23  {
24  bool transpose = false;
25  SetUniformM44(mvp, m_mvpUniformLocation, transpose);
26  }
27 
28  void Use(Rendering::GLState& glState) const
29  {
30  UseProgram(glState);
31  }
32 
33  protected:
35  const TShaderId shaderId,
36  const std::string& vertexShaderCode,
37  const std::string& fragmentShaderCode);
38 
39  private:
40  GLuint m_mvpUniformLocation;
41  };
42  }
43  }
44 }