mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-19 08:03:21 +02:00
46 lines
1 KiB
C++
46 lines
1 KiB
C++
|
#include "CursorPassElement.hpp"
|
||
|
#include "renderer.hpp"
|
||
|
|
||
|
#include <hyprland/src/render/pass/TexPassElement.hpp>
|
||
|
#include <hyprland/src/render/OpenGL.hpp>
|
||
|
|
||
|
#include <hyprutils/utils/ScopeGuard.hpp>
|
||
|
using namespace Hyprutils::Utils;
|
||
|
|
||
|
CCursorPassElement::CCursorPassElement(const CCursorPassElement::SRenderData& data_) : data(data_) {
|
||
|
;
|
||
|
}
|
||
|
|
||
|
void CCursorPassElement::draw(const CRegion& damage) {
|
||
|
renderCursorTextureInternalWithDamage(
|
||
|
data.tex,
|
||
|
&data.box,
|
||
|
data.damage.empty() ? damage : data.damage,
|
||
|
1.F,
|
||
|
data.hotspot,
|
||
|
data.nearest,
|
||
|
data.stretchAngle,
|
||
|
data.stretchMagnitude
|
||
|
);
|
||
|
}
|
||
|
|
||
|
bool CCursorPassElement::needsLiveBlur() {
|
||
|
return false; // TODO?
|
||
|
}
|
||
|
|
||
|
bool CCursorPassElement::needsPrecomputeBlur() {
|
||
|
return false; // TODO?
|
||
|
}
|
||
|
|
||
|
std::optional<CBox> CCursorPassElement::boundingBox() {
|
||
|
return data.box.copy().scale(1.F / g_pHyprOpenGL->m_RenderData.pMonitor->scale).round();
|
||
|
}
|
||
|
|
||
|
CRegion CCursorPassElement::opaqueRegion() {
|
||
|
return {}; // TODO:
|
||
|
}
|
||
|
|
||
|
void CCursorPassElement::discard() {
|
||
|
;
|
||
|
}
|