material.hpp 660 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // material.hpp
  3. // graphics
  4. //
  5. // Created by Sam Jaffe on 7/5/16.
  6. //
  7. #pragma once
  8. #include <vector>
  9. #include "game/graphics/graphics_fwd.h"
  10. #include "game/math/math_fwd.hpp"
  11. #include "vector/vector.hpp"
  12. namespace graphics {
  13. struct uniform {
  14. identity<texture> texture;
  15. int uniform_id; // TODO (sjaffe): use an enum and hide remapping?
  16. };
  17. struct material : public identity<material> {
  18. material(identity<shader_program> const & sp, math::vec2i size,
  19. std::vector<uniform> const & uniforms);
  20. void activate() const;
  21. identity<shader_program> program;
  22. math::vec2i size;
  23. std::vector<uniform> uniforms;
  24. };
  25. }