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