texture.hpp 620 B

1234567891011121314151617181920212223242526272829
  1. //
  2. // texture.hpp
  3. // graphics
  4. //
  5. // Created by Sam Jaffe on 7/5/16.
  6. //
  7. #pragma once
  8. #include "game/math/math_fwd.hpp"
  9. #include "game/util/flyweight.hpp"
  10. #include "vector/vector.hpp"
  11. namespace graphics {
  12. class texture : public identity<texture> {
  13. public:
  14. static texture const WHITE();
  15. static texture const DARK_YELLOW();
  16. static texture const LIGHT_BLUE();
  17. math::vec2i const size;
  18. public:
  19. static flyweight<texture> create(std::string const & imagefile);
  20. private:
  21. static texture create(char const *, math::vec2i);
  22. texture(unsigned int, math::vec2i = math::vec2i{{0, 0}});
  23. };
  24. }