mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-25 21:30:04 +01:00
use nearest-neighbor filtering for cursor scaling to avoid blurriness
This commit is contained in:
parent
5212099b9f
commit
7ce451d20c
1 changed files with 10 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue