From e1edfde539557d175f8c48d94996469426da7c47 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Mon, 12 Jun 2023 00:30:31 +0700 Subject: Allow setting alpha value for ignorezero layer rule (#2477) * rename ignorezero to ignorealpha * allow setting ignorealpha value This commit allows setting a float value (0-1) for the ignorealpha layer rule. Does not yet have error handling; invalid ignorealpha layer rule will crash Hyprland. * add brackets i forgot to add * prevent crash with invalid ignorealpha value prevents hyprland from immediately crashing with invalid ignorealpha layer rule does not log * don't try to set ignoreAlphaValue if alpha value not specified * add catch to try, reintroduce ignorezero - added catch after try cuz i was an idiot - re-add ignorezero as an alternative to ignorealpha to not introduce a breaking change * add logging for failed ignorealpha layer rule * fix get ignorealpha's get VALUE * check npos and use empty() * rename VALUE cuz no longer const * format Shader.hpp --- src/render/Shader.hpp | 59 ++++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 29 deletions(-) (limited to 'src/render/Shader.hpp') diff --git a/src/render/Shader.hpp b/src/render/Shader.hpp index 416e62fe..a9c1f7a6 100644 --- a/src/render/Shader.hpp +++ b/src/render/Shader.hpp @@ -7,44 +7,45 @@ class CShader { public: ~CShader(); - GLuint program = 0; - GLint proj; - GLint color; - GLint tex; - GLint alpha; - GLint posAttrib; - GLint texAttrib; - GLint discardOpaque; - GLint discardAlphaZero; + GLuint program = 0; + GLint proj; + GLint color; + GLint tex; + GLint alpha; + GLint posAttrib; + GLint texAttrib; + GLint discardOpaque; + GLint discardAlpha; + GLfloat discardAlphaValue; - GLint topLeft; - GLint bottomRight; - GLint fullSize; - GLint fullSizeUntransformed; - GLint radius; - GLint primitiveMultisample; + GLint topLeft; + GLint bottomRight; + GLint fullSize; + GLint fullSizeUntransformed; + GLint radius; + GLint primitiveMultisample; - GLint thick; + GLint thick; - GLint halfpixel; + GLint halfpixel; - GLint range; - GLint shadowPower; + GLint range; + GLint shadowPower; - GLint applyTint; - GLint tint; + GLint applyTint; + GLint tint; - GLint gradient; - GLint gradientLength; - GLint angle; + GLint gradient; + GLint gradientLength; + GLint angle; - GLint time; - GLint distort; - GLint output; + GLint time; + GLint distort; + GLint output; - GLint getUniformLocation(const std::string&); + GLint getUniformLocation(const std::string&); - void destroy(); + void destroy(); private: std::unordered_map m_muUniforms; -- cgit v1.2.3