add post-effect-slot resource & add gfx.posteffects library

This commit is contained in:
MihailRis
2025-04-06 12:47:25 +03:00
parent c3bc084e76
commit 64039f0e43
11 changed files with 182 additions and 12 deletions
+5 -1
View File
@@ -21,7 +21,7 @@ class PostProcessing {
std::unique_ptr<Mesh> quadMesh;
std::vector<std::shared_ptr<PostEffect>> effectSlots;
public:
PostProcessing();
PostProcessing(size_t effectSlotsCount);
~PostProcessing();
/// @brief Prepare and bind framebuffer
@@ -34,6 +34,10 @@ public:
/// @throws std::runtime_error if use(...) wasn't called before
void render(const DrawContext& context, const Assets& assets, float timer);
void setEffect(size_t slot, std::shared_ptr<PostEffect> effect);
PostEffect* getEffect(size_t slot);
/// @brief Make an image from the last rendered frame
std::unique_ptr<ImageData> toImage();