FBOProvider.h 984 B

1234567891011121314151617181920212223242526272829
  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. private:
  20. const FBOProvider* m_parent;
  21. std::map<std::string, std::shared_ptr<CFBO>> m_fbos = {};
  22. };
  23. }