diff options
| author | jmanc3 <jman12316@live.com> | 2026-01-27 15:21:53 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-27 21:21:53 +0000 |
| commit | c8b5023bb0610be4d1d2987ef05168834b2661ba (patch) | |
| tree | 78eba71d4ad46d8049f04eeb179a8114264c6ed3 /src/render | |
| parent | bcb34275eaaa3b3eb2dd479b582a3b47bcc4b305 (diff) | |
opengl: allow texture filter to be changed (#13078)
* opengl: allow texture filter to be changed
* format
* correct filter
* Moved from OpenGL.hpp to Texture.hpp
* Shortened names
Diffstat (limited to 'src/render')
| -rw-r--r-- | src/render/OpenGL.cpp | 8 | ||||
| -rw-r--r-- | src/render/Texture.hpp | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 6c75148e..715ca4f7 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -1363,8 +1363,8 @@ void CHyprOpenGLImpl::renderTextureInternal(SP<CTexture> tex, const CBox& box, c 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); + tex->setTexParameter(GL_TEXTURE_MAG_FILTER, tex->magFilter); + tex->setTexParameter(GL_TEXTURE_MIN_FILTER, tex->minFilter); } const bool isHDRSurface = m_renderData.surface.valid() && m_renderData.surface->m_colorManagement.valid() ? m_renderData.surface->m_colorManagement->isHDR() : false; @@ -1616,8 +1616,8 @@ void CHyprOpenGLImpl::renderTexturePrimitive(SP<CTexture> tex, const CBox& box) 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); + tex->setTexParameter(GL_TEXTURE_MAG_FILTER, tex->magFilter); + tex->setTexParameter(GL_TEXTURE_MIN_FILTER, tex->minFilter); } auto shader = useShader(m_shaders->frag[SH_FRAG_PASSTHRURGBA]); diff --git a/src/render/Texture.hpp b/src/render/Texture.hpp index 8ee2cab0..c2e9b2c3 100644 --- a/src/render/Texture.hpp +++ b/src/render/Texture.hpp @@ -49,6 +49,9 @@ class CTexture { uint32_t m_drmFormat = 0; // for shm bool m_isSynchronous = false; + GLenum magFilter = GL_LINEAR; // useNearestNeighbor overwrites these + GLenum minFilter = GL_LINEAR; + private: enum eTextureParam : uint8_t { TEXTURE_PAR_WRAP_S = 0, |
