aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/render/Transformer.hpp
blob: c54da4ddcc2550d66bf5b084382c86362fcffaf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include "Framebuffer.hpp"

struct SRenderData;

// A window transformer can be attached to a window.
// If any is attached, Hyprland will render the window to a separate fb, then call the transform() func with it,
// and finally render it back to the main fb after all transformers pass.
//
// Worth noting transformers for now only affect the main pass (not popups)
class IWindowTransformer {
  public:
    virtual ~IWindowTransformer() = default;

    // called by Hyprland. For more data about what is being rendered, inspect render data.
    // returns the out fb.
    virtual CFramebuffer* transform(CFramebuffer* in) = 0;

    // called by Hyprland before a window main pass is started.
    virtual void preWindowRender(SRenderData* pRenderData);
};