OverlayShader.h 649 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef OVERLAYSHADER_H
  2. #define OVERLAYSHADER_H
  3. #include "client/engine/shader/ShaderProgram.h"
  4. #include "client/math/Matrix3D.h"
  5. class OverlayShader
  6. {
  7. public:
  8. OverlayShader();
  9. virtual ~OverlayShader();
  10. bool init();
  11. void preRender();
  12. void setViewMatrix();
  13. void setModelMatrix(const float* data);
  14. void setUseTexture(bool use);
  15. void setUseColor(bool use);
  16. private:
  17. // shader
  18. ShaderProgram program;
  19. // uniform data
  20. Matrix3D view;
  21. // uniforms locations
  22. GLint unifUseTexture = 0;
  23. GLint unifUseColor = 0;
  24. GLint unifViewMatrix = 0;
  25. GLint unifModelMatrix = 0;
  26. };
  27. #endif