CBind.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include <string>
  3. #include "WallpaperEngine/Core/Core.h"
  4. namespace WallpaperEngine::Core::Objects::Effects {
  5. using json = nlohmann::json;
  6. /**
  7. * Material's bind information, describes for passes what textures to bind
  8. * in what positions for shaders. Used to override the textures specified inside
  9. * the object's passes
  10. */
  11. class CBind {
  12. public:
  13. /**
  14. * Parses bind information off the given json data
  15. *
  16. * @param data
  17. * @return
  18. */
  19. static const CBind* fromJSON (const json& data);
  20. /**
  21. * @return The texture name, previous to use the one already specified by the object's passes
  22. */
  23. [[nodiscard]] const std::string& getName () const;
  24. /**
  25. * @return The texture index to replace
  26. */
  27. [[nodiscard]] const uint32_t& getIndex () const;
  28. protected:
  29. CBind (std::string name, uint32_t index);
  30. private:
  31. /** The texture's name */
  32. const std::string m_name;
  33. /** The texture index to replace */
  34. const uint32_t m_index;
  35. };
  36. } // namespace WallpaperEngine::Core::Objects::Effects