diff options
author | Mark Janes <mark.a.janes@intel.com> | 2017-10-31 16:24:08 -0700 |
---|---|---|
committer | Mark Janes <mark.a.janes@intel.com> | 2017-11-27 11:29:21 -0800 |
commit | 5e78e8fbb214f20c9b75f1d759a4b52cadc36c36 (patch) | |
tree | 3d2418681bd050bf09382f082cab8355ff809a30 /retrace | |
parent | f016abdf61cd3ba6c8efd00afc28db65fb3c5fee (diff) |
state: Refactor glBlendFunc
The implementation of glBlendEquation was clearer and more organized
than the initial implementation of glBlendFunc. This commit change
glBlendFunc to use the clearer mechanism.
Diffstat (limited to 'retrace')
-rw-r--r-- | retrace/daemon/glframe_state_override.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/retrace/daemon/glframe_state_override.cpp b/retrace/daemon/glframe_state_override.cpp index 2dfe5077..ccc4b94a 100644 --- a/retrace/daemon/glframe_state_override.cpp +++ b/retrace/daemon/glframe_state_override.cpp @@ -168,19 +168,15 @@ StateOverride::enact_state(const KeyMap &m) const { assert(GL::GetError() == GL_NO_ERROR); break; } - case GL_BLEND_SRC: { - GLint dst; - GlFunctions::GetIntegerv(GL_BLEND_DST, &dst); - assert(GL::GetError() == GL_NO_ERROR); - GlFunctions::BlendFunc(i.second[0], dst); - assert(GL::GetError() == GL_NO_ERROR); - break; - } + case GL_BLEND_SRC: case GL_BLEND_DST: { - GLint src; - GlFunctions::GetIntegerv(GL_BLEND_DST, &src); + GLint src, dst; + GlFunctions::GetIntegerv(GL_BLEND_DST, &dst); + GlFunctions::GetIntegerv(GL_BLEND_SRC, &src); assert(GL::GetError() == GL_NO_ERROR); - GlFunctions::BlendFunc(src, i.second[0]); + GlFunctions::BlendFunc( + n == GL_BLEND_SRC ? i.second[0] : src, + n == GL_BLEND_DST ? i.second[0] : dst); assert(GL::GetError() == GL_NO_ERROR); break; } |