From ff869777a9ee3f87f87b12adada44283470cc713 Mon Sep 17 00:00:00 2001 From: Mario Liebisch Date: Mon, 28 Apr 2014 21:30:22 +0200 Subject: [PATCH] Fixed building for OpenGL ES 1.1 platforms * Added proper extension handling for `glBlendEquation` and related constants (required for OpenGL ES 1.1). --- src/SFML/Graphics/GLExtensions.hpp | 6 ++++++ src/SFML/Graphics/RenderTarget.cpp | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/SFML/Graphics/GLExtensions.hpp b/src/SFML/Graphics/GLExtensions.hpp index 34e3da8bc..18fb7bba6 100644 --- a/src/SFML/Graphics/GLExtensions.hpp +++ b/src/SFML/Graphics/GLExtensions.hpp @@ -62,6 +62,9 @@ #define GLEXT_glClientActiveTexture glClientActiveTexture #define GLEXT_glActiveTexture glActiveTexture #define GLEXT_GL_TEXTURE0 GL_TEXTURE0 + #define GLEXT_glBlendEquation glBlendEquationOES + #define GLEXT_GL_FUNC_ADD GL_FUNC_ADD_OES + #define GLEXT_GL_FUNC_SUBTRACT GL_FUNC_SUBTRACT_OES #else @@ -96,6 +99,9 @@ #define GLEXT_glClientActiveTexture glClientActiveTextureARB #define GLEXT_glActiveTexture glActiveTextureARB #define GLEXT_GL_TEXTURE0 GL_TEXTURE0_ARB + #define GLEXT_glBlendEquation glBlendEquation + #define GLEXT_GL_FUNC_ADD GL_FUNC_ADD + #define GLEXT_GL_FUNC_SUBTRACT GL_FUNC_SUBTRACT #endif diff --git a/src/SFML/Graphics/RenderTarget.cpp b/src/SFML/Graphics/RenderTarget.cpp index 5fa6cccd0..a361f7ad3 100644 --- a/src/SFML/Graphics/RenderTarget.cpp +++ b/src/SFML/Graphics/RenderTarget.cpp @@ -63,8 +63,8 @@ namespace switch (blendEquation) { default: - case sf::BlendMode::Add: return GL_FUNC_ADD; - case sf::BlendMode::Subtract: return GL_FUNC_SUBTRACT; + case sf::BlendMode::Add: return GLEXT_GL_FUNC_ADD; + case sf::BlendMode::Subtract: return GLEXT_GL_FUNC_SUBTRACT; } } } @@ -442,7 +442,7 @@ void RenderTarget::applyBlendMode(const BlendMode& mode) } else { - glCheck(glBlendEquation(equationToGlConstant(mode.colorEquation))); + glCheck(GLEXT_glBlendEquation(equationToGlConstant(mode.colorEquation))); } m_cache.lastBlendMode = mode;