Guest User

shader.h

a guest
Dec 1st, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #ifndef RENDER_ENGINE_SHADER_H
  2. #define RENDER_ENGINE_SHADER_H
  3.  
  4. #include "CommonInclude.h"
  5. #include "IO.h"
  6. #include <sstream>
  7. #include <map>
  8.  
  9. class shader
  10. {
  11. private:
  12. void LoadShader(std::string vertexSource, std::string fragmentSource, std::string vertexPath = "", std::string fragmentPath = "");
  13.  
  14. std::map<std::string, GLint> uniformLocation;
  15. std::map<std::string, GLint> attribLocation;
  16. public:
  17. std::string shaderName;
  18. GLuint programID;
  19.  
  20. shader(bool initFromFile, std::string vertex, std::string fragment);
  21. shader();
  22. void LoadShaderFromFile(std::string vertexPath, std::string fragmentPath);
  23. void LoadShaderFromSource(std::string vertexSource, std::string fragmentSource);
  24. void BindUniformLocation(char* uniformName);
  25. void BindAttribLocation(char* attribName);
  26. GLint GetUniformLocation(char* uniformName);
  27. GLint GetAttribLocation(char* attribName);
  28. ~shader();
  29. };
  30.  
  31. #endif
Advertisement
Add Comment
Please, Sign In to add comment