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.

53 lines
1.1 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://sam.zoy.org/projects/COPYING.WTFPL for more details.
  9. //
  10. //
  11. // The Shader class
  12. // ----------------
  13. //
  14. #if !defined __LOL_SHADER_H__
  15. #define __LOL_SHADER_H__
  16. namespace lol
  17. {
  18. class ShaderData;
  19. class Shader
  20. {
  21. public:
  22. static Shader *Create(char const *vert, char const *frag);
  23. static void Destroy(Shader *shader);
  24. int GetAttribLocation(char const *attr) const;
  25. int GetUniformLocation(char const *uni) const;
  26. void SetUniform(int uni, float f);
  27. void SetUniform(int uni, vec2 const &v);
  28. void SetUniform(int uni, vec3 const &v);
  29. void SetUniform(int uni, vec4 const &v);
  30. void SetUniform(int uni, mat4 const &m);
  31. void Bind() const;
  32. protected:
  33. Shader(char const *vert, char const *frag);
  34. ~Shader();
  35. private:
  36. ShaderData *data;
  37. };
  38. } /* namespace lol */
  39. #endif // __LOL_SHADER_H__