Commits

Alex Szpakowski committed 6cb3ba5

Fixed love.graphics.getBlendMode on systems which don't support the subtractive blend mode

  • Participants
  • Parent commits 2061cc4

Comments (0)

Files changed (1)

src/modules/graphics/opengl/Graphics.cpp

 
 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;