Virtual Testbed
Ship dynamics simulator for extreme conditions
SliceShader.hh
1 #ifndef VTESTBED_GRAPHICS_SLICESHADER_HH
2 #define VTESTBED_GRAPHICS_SLICESHADER_HH
3 
4 #include <Magnum/GL/AbstractShaderProgram.h>
5 #include <Magnum/GL/Texture.h>
6 
7 #include <vtestbed/graphics/types.hh>
8 
9 namespace vtb {
10 
11  namespace graphics {
12 
13  class SliceShader: public Magnum::GL::AbstractShaderProgram {
14 
15  public:
16  typedef Magnum::GL::Attribute<0, Vector3> Position;
17  typedef Magnum::GL::Attribute<1, Vector2> Texture;
18 
19  private:
20  enum {
21  TextureLocation,
22  MatrixLocation
23  };
24 
25  public:
26 
27  SliceShader();
28 
29  inline void
30  setTransformationProjectionMatrix(const Matrix4& matrix) {
31  setUniform(MatrixLocation, matrix);
32  }
33 
34  inline void
35  bindTexture(Texture2D& texture) {
36  texture.bind(TextureLocation);
37  }
38 
39  };
40 
41  }
42 
43 }
44 
45 #endif // vim:filetype=cpp
Main namespace.
Definition: convert.hh:9