diff options
| author | end-4 <97237370+end-4@users.noreply.github.com> | 2023-06-12 00:30:31 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-11 19:30:31 +0200 |
| commit | e1edfde539557d175f8c48d94996469426da7c47 (patch) | |
| tree | b14dd7f02cb6c06a26ec1a72c5cb34b353dc15c6 /src/render/Shader.hpp | |
| parent | 10fd75c8335736b1a0dcb3830a5b8c2367a02e61 (diff) | |
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
Diffstat (limited to 'src/render/Shader.hpp')
| -rw-r--r-- | src/render/Shader.hpp | 59 |
1 files changed, 30 insertions, 29 deletions
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<std::string, GLint> m_muUniforms; |
