summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2025-12-27 20:18:50 +0100
committerVaxry <vaxry@vaxry.net>2025-12-27 20:18:57 +0100
commit610c59dc34225bad1c610388e43e8937276e43ff (patch)
tree245a2ef804baed70ff0c33071d5684df9e18db6f /src/render/OpenGL.cpp
parente5f22c06b4c01784753315156247e15d0ec3db45 (diff)
opengl: properly combine transforms in renderTexture
ref #12666
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 9a5d6ad0..33e380e1 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -1640,10 +1640,11 @@ void CHyprOpenGLImpl::renderTextureInternal(SP<CTexture> tex, const CBox& box, c
static const auto PCURSORTIMEOUT = CConfigValue<Hyprlang::FLOAT>("cursor:inactive_timeout");
// get the needed transform for this texture
- const bool TRANSFORMS_MATCH = Math::wlTransformToHyprutils(m_renderData.pMonitor->m_transform) == tex->m_transform; // FIXME: combine them properly!!!
- eTransform TRANSFORM = HYPRUTILS_TRANSFORM_NORMAL;
- if (m_monitorTransformEnabled || TRANSFORMS_MATCH)
- TRANSFORM = Math::wlTransformToHyprutils(Math::invertTransform(m_renderData.pMonitor->m_transform));
+ const auto MONITOR_INVERTED = Math::wlTransformToHyprutils(Math::invertTransform(m_renderData.pMonitor->m_transform));
+ Hyprutils::Math::eTransform TRANSFORM = tex->m_transform;
+
+ if (m_monitorTransformEnabled)
+ TRANSFORM = Math::composeTransform(MONITOR_INVERTED, TRANSFORM);
Mat3x3 matrix = m_renderData.monitorProjection.projectBox(newBox, TRANSFORM, newBox.rot);
Mat3x3 glMatrix = m_renderData.projection.copy().multiply(matrix);