manager.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // manager.hpp
  3. // graphics
  4. //
  5. // Created by Sam Jaffe on 5/25/19.
  6. // Copyright © 2019 Sam Jaffe. All rights reserved.
  7. //
  8. #pragma once
  9. #include <unordered_map>
  10. #include "game/util/identity.hpp"
  11. namespace graphics {
  12. namespace shaders {
  13. enum class type : unsigned int;
  14. }
  15. class material;
  16. class shader;
  17. class shader_program;
  18. class texture;
  19. class manager {
  20. public:
  21. manager();
  22. ~manager();
  23. identity<material> get(identity<shader_program> program,
  24. std::string const & texture,
  25. std::string const & uniform) const;
  26. identity<shader> get(shaders::type type, std::string const & path) const;
  27. identity<shader_program> get(std::string const & fragment,
  28. std::string const & vertex) const;
  29. identity<texture> get(std::string const & path) const;
  30. material const & get(identity<material> identity) const;
  31. private:
  32. identity<texture> texture_or_uniform(std::string const & path,
  33. std::string const & uniform) const;
  34. std::unique_ptr<struct manager_impl> pimpl_;
  35. };
  36. }