FBOProvider.h 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include <glm/vec2.hpp>
  3. #include <glm/vec4.hpp>
  4. #include "CFBO.h"
  5. #include "WallpaperEngine/Data/Model/Effect.h"
  6. namespace WallpaperEngine::Render {
  7. using namespace WallpaperEngine::Data::Model;
  8. class FBOProvider {
  9. public:
  10. explicit FBOProvider (const FBOProvider* parent);
  11. /** An effect.json buffer for an object of the given size (sub_1401EA500) */
  12. std::shared_ptr<CFBO> create (const FBO& base, glm::vec2 objectSize, bool hdr);
  13. std::shared_ptr<CFBO> create (
  14. const std::string& name, TextureFormat format, uint32_t flags, float scale, glm::vec2 realSize,
  15. glm::vec2 textureSize, const glm::vec4& borderColor = { 0.0f, 0.0f, 0.0f, 1.0f }, uint32_t mipLevels = 1
  16. );
  17. std::shared_ptr<CFBO> alias (const std::string& newName, const std::string& original);
  18. [[nodiscard]] std::shared_ptr<CFBO> find (const std::string& name) const;
  19. /** Drops this provider's name for a buffer, whoever else holds it keeps it alive */
  20. void remove (const std::string& name);
  21. private:
  22. const FBOProvider* m_parent;
  23. std::map<std::string, std::shared_ptr<CFBO>> m_fbos = {};
  24. };
  25. }