diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2016-04-07 21:22:31 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-04-11 08:00:15 +0000 |
commit | dc58fc97ed9a36fa454eaa43e6f1cd7dc13a6d2d (patch) | |
tree | 925bf7fc16fba19ca975f0e92af1bb9a2ca35894 /src/render/graphicshelpers/graphicshelpergl3_3.cpp | |
parent | 19a8c6b46cb538ee4e628cbe50f6fa549094d7eb (diff) |
Properly handle alpha to coverage state in non-cloning codepath
Also improve the alpha to coverage handlign in the helpers by using
a single function rather than two.
This removes GL errors about bad glFace enum values (caused by bad
handlign of alpha to coverage in switch statement, which led to a
FrontFace state being created with bad data).
Change-Id: I832d92fcb07134525f421d3a3b4d12e9f5f6428c
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/graphicshelpers/graphicshelpergl3_3.cpp')
-rw-r--r-- | src/render/graphicshelpers/graphicshelpergl3_3.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/render/graphicshelpers/graphicshelpergl3_3.cpp b/src/render/graphicshelpers/graphicshelpergl3_3.cpp index c66ad601c..70c7cf53e 100644 --- a/src/render/graphicshelpers/graphicshelpergl3_3.cpp +++ b/src/render/graphicshelpers/graphicshelpergl3_3.cpp @@ -305,14 +305,10 @@ void GraphicsHelperGL3_3::frontFace(GLenum mode) } -void GraphicsHelperGL3_3::enableAlphaCoverage() +void GraphicsHelperGL3_3::setAlphaCoverageEnabled(bool enabled) { - m_funcs->glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE); -} - -void GraphicsHelperGL3_3::disableAlphaCoverage() -{ - m_funcs->glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE); + enabled ? m_funcs->glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE) + : m_funcs->glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE); } GLuint GraphicsHelperGL3_3::createFrameBufferObject() |