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);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
tex->bind();
|
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);
|
useProgram(shader->program);
|
||||||
shader->setUniformMatrix3fv(SHADER_PROJ, 1, GL_TRUE, glMatrix.getMatrix());
|
shader->setUniformMatrix3fv(SHADER_PROJ, 1, GL_TRUE, glMatrix.getMatrix());
|
||||||
shader->setUniformInt(SHADER_TEX, 0);
|
shader->setUniformInt(SHADER_TEX, 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue