Virtual Testbed
Ship dynamics simulator for extreme conditions
SurfaceShader.hh
1 #ifndef VTESTBED_GRAPHICS_SURFACESHADER_HH
2 #define VTESTBED_GRAPHICS_SURFACESHADER_HH
3 
4 
5 #include <vtestbed/graphics/types.hh>
6 
7 namespace vtb {
8 
9  namespace graphics {
10 
11  class SurfaceShader: public AbstractShaderProgram {
12 
13  public:
14  typedef Magnum::GL::Attribute<0, Vector3> Position;
15  typedef Magnum::GL::Attribute<1, Vector2> Texture;
16 
17  private:
18  enum {
19  TextureLocation,
20  Matrix,
21  Slice,
22  ShowSlice,
23  MaxWave
24  };
25 
26  public:
27 
28  SurfaceShader();
29 
30  inline void
31  setTransformationProjectionMatrix(const Matrix4& matrix) {
32  setUniform(Matrix, matrix);
33  }
34 
35  inline void
36  bindTexture(Texture2D& texture) {
37  texture.bind(TextureLocation);
38  }
39 
40  inline void
41  setSlice(const Vector2& vect) {
42  setUniform(Slice, vect);
43  }
44 
45  inline void
46  showSlice(bool value) {
47  setUniform(ShowSlice, value);
48  }
49 
50  inline void
51  setMaxWave(float maxWave) {
52  setUniform(MaxWave, maxWave);
53  }
54 
55  };
56 
57  }
58 
59 }
60 
61 #endif // vim:filetype=cpp
Main namespace.
Definition: convert.hh:9