From 8c21c4dce03ec1de92f677d48fe25ade262d91f5 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 17 Feb 2013 00:19:46 -0400 Subject: [PATCH] Fixed love.graphics.getBlendMode on systems which don't support the subtractive blend mode --- src/modules/graphics/opengl/Graphics.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index 0f01e9dbb..f9cd1c7d1 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -551,10 +551,14 @@ void Graphics::setColorMode(Graphics::ColorMode mode) Graphics::BlendMode Graphics::getBlendMode() const { - GLint dst, src, equation; + GLint dst, src; glGetIntegerv(GL_BLEND_DST, &dst); glGetIntegerv(GL_BLEND_SRC, &src); - glGetIntegerv(GL_BLEND_EQUATION, &equation); + + GLint equation = GL_FUNC_ADD; + + if (GLEE_VERSION_1_4 || GLEE_ARB_imaging || (GLEE_EXT_blend_minmax && GLEE_EXT_blend_subtract)) + glGetIntegerv(GL_BLEND_EQUATION, &equation); if (equation == GL_FUNC_REVERSE_SUBTRACT) // && src == GL_SRC_ALPHA && dst == GL_ONE return BLEND_SUBTRACTIVE;