All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ScreenSpaceRouteViewShader.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Shader.h"
6 #include "Rendering.h"
7 
8 namespace Eegeo
9 {
10  namespace Routes
11  {
12  namespace View
13  {
15  {
16  public:
17  static ScreenSpaceRouteViewShader* Create(const Rendering::TShaderId shaderId);
18 
19  ScreenSpaceRouteViewShader(const Rendering::TShaderId shaderId, const std::string& vertexCode, const std::string& fragmentCode);
20 
21  void Use(Rendering::GLState& glState) const
22  {
23  UseProgram(glState);
24  }
25 
26  void SetModelView(const m44& modelView) const
27  {
28  const bool transpose = false;
29  SetUniformM44(modelView, m_modelViewUniform, transpose);
30  }
31 
32  void SetModelViewInverseTranspose(const m44& modelViewInverseTranspose)
33  {
34  const bool transpose = false;
35  SetUniformM44(modelViewInverseTranspose, m_modelViewInverseTransposeUniform, transpose);
36  }
37 
38  void SetProjection(const m44& modelView)
39  {
40  const bool transpose = false;
41  SetUniformM44(modelView, m_projectionUniform, transpose);
42  }
43 
44  void SetAltitudeFade(float fade)
45  {
46  SetUniformFloat(fade, m_altitudeFadeUniform);
47  }
48 
49  void SetThickness(float thickness)
50  {
51  SetUniformFloat(thickness, m_thicknessUniform);
52  }
53 
54  void SetAspect(float aspect)
55  {
56  SetUniformFloat(aspect, m_aspectUniform);
57  }
58 
59  void SetMVP(const m44& mvp) const
60  {
61 
62  }
63 
64  private:
65 
66  GLuint m_modelViewUniform;
67  GLuint m_modelViewInverseTransposeUniform;
68  GLuint m_projectionUniform;
69  GLuint m_altitudeFadeUniform;
70  GLuint m_thicknessUniform;
71  GLuint m_aspectUniform;
72  };
73  }
74  }
75 }