CFBO.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include "WallpaperEngine/Core/Core.h"
  3. #include <nlohmann/json.hpp>
  4. #include <string>
  5. namespace WallpaperEngine::Core::Objects::Effects {
  6. using json = nlohmann::json;
  7. /**
  8. * FBO = Frame Buffer Object
  9. *
  10. * Represents a framebuffer object used in objects with multiple effects or render passes
  11. */
  12. class CFBO {
  13. public:
  14. static const CFBO* fromJSON (const json& data);
  15. /**
  16. * @return The FBO name used to identify it in the background's files
  17. */
  18. [[nodiscard]] const std::string& getName () const;
  19. /**
  20. * @return The scale factor of the FBO
  21. */
  22. [[nodiscard]] const float& getScale () const;
  23. /**
  24. * @return The FBO's format for the render
  25. */
  26. [[nodiscard]] const std::string& getFormat () const;
  27. protected:
  28. CFBO (std::string name, float scale, std::string format);
  29. private:
  30. /** The name of the FBO */
  31. const std::string m_name;
  32. /** The scale factor of the FBO */
  33. const float m_scale;
  34. /** The FBO's format for the render */
  35. const std::string m_format;
  36. };
  37. } // namespace WallpaperEngine::Core::Objects::Effects