You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
548 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #pragma once
  2. #include "ggl.h"
  3. struct UniformTexture {
  4. GLint mLocation;
  5. GLuint mTexture;
  6. UniformTexture() {
  7. mLocation = -1;
  8. mTexture = 0;
  9. }
  10. };
  11. class Shader {
  12. public:
  13. GLuint mProgram;
  14. std::map<std::string, UniformTexture*> mUniformTextures;
  15. GLint mModelMatrixLocation, mViewMatrixLocation, mProjectionMatrixLocation;
  16. GLint mPositionLocation, mColorLocation, mTexcoordLocation, mNormalLocation;
  17. void Init(const char*vs, const char*fs);
  18. void Bind(float *M, float *V, float*P);
  19. void SetTexture(const char * name, const char*imagePath);
  20. };