diff options
| author | João V. Farias <51831435+BeyondMagic@users.noreply.github.com> | 2025-09-25 16:14:04 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-25 21:14:04 +0200 |
| commit | 7ce451d20c33025d4aaaf55444150c4a875b83ea (patch) | |
| tree | f7a1338e8c96e1ed2485e161dd84bb01cf1bb735 /src/render/OpenGL.cpp | |
| parent | 5212099b9f115932b84bcdb8c29b536f5ce385e4 (diff) | |
renderer: disable anti-aliasing on cursor:zoom_factor (#6135) (#11828)
use nearest-neighbor filtering for cursor scaling to avoid blurriness
Diffstat (limited to 'src/render/OpenGL.cpp')
| -rw-r--r-- | src/render/OpenGL.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 3cb810e1..e1ecdd2f 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -1760,6 +1760,16 @@ void CHyprOpenGLImpl::renderTexturePrimitive(SP<CTexture> tex, const CBox& box) glActiveTexture(GL_TEXTURE0); tex->bind(); + // ensure the final blit uses the desired sampling filter + // when cursor zoom is active we want nearest-neighbor (no anti-aliasing) + if (m_renderData.useNearestNeighbor) { + tex->setTexParameter(GL_TEXTURE_MAG_FILTER, GL_NEAREST); + tex->setTexParameter(GL_TEXTURE_MIN_FILTER, GL_NEAREST); + } else { + tex->setTexParameter(GL_TEXTURE_MAG_FILTER, GL_LINEAR); + tex->setTexParameter(GL_TEXTURE_MIN_FILTER, GL_LINEAR); + } + useProgram(shader->program); shader->setUniformMatrix3fv(SHADER_PROJ, 1, GL_TRUE, glMatrix.getMatrix()); shader->setUniformInt(SHADER_TEX, 0); |
