CImage.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #include <irrlicht/irrlicht.h>
  3. #include "WallpaperEngine/Core/Objects/Images/CMaterial.h"
  4. #include "WallpaperEngine/Core/Core.h"
  5. #include "WallpaperEngine/Core/CObject.h"
  6. #include "WallpaperEngine/Assets/CContainer.h"
  7. namespace WallpaperEngine::Core::Objects
  8. {
  9. using json = nlohmann::json;
  10. using namespace WallpaperEngine::Assets;
  11. class CImage : public CObject
  12. {
  13. friend class CObject;
  14. public:
  15. static CObject* fromJSON (
  16. json data,
  17. CContainer* container,
  18. bool visible,
  19. irr::u32 id,
  20. std::string name,
  21. const glm::vec3& origin,
  22. const glm::vec3& scale,
  23. const glm::vec3& angles
  24. );
  25. const Images::CMaterial* getMaterial () const;
  26. const glm::vec2& getSize () const;
  27. const std::string& getAlignment () const;
  28. protected:
  29. CImage (
  30. Images::CMaterial* material,
  31. bool visible,
  32. irr::u32 id,
  33. std::string name,
  34. const glm::vec3& origin,
  35. const glm::vec3& scale,
  36. const glm::vec3& angles,
  37. const glm::vec2& size,
  38. std::string alignment
  39. );
  40. static const std::string Type;
  41. private:
  42. glm::vec2 m_size;
  43. Images::CMaterial* m_material;
  44. std::string m_alignment;
  45. };
  46. };