From b193764e6efc12c456a0e26ef1fbee1da35913dc Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Tue, 31 Oct 2017 11:15:50 +0100 Subject: [PATCH] Fix transp png images have border, close #122 --- src/Surfaces/SurfaceStack.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Surfaces/SurfaceStack.cpp b/src/Surfaces/SurfaceStack.cpp index e0e9e30..89651a6 100644 --- a/src/Surfaces/SurfaceStack.cpp +++ b/src/Surfaces/SurfaceStack.cpp @@ -26,8 +26,14 @@ void SurfaceStack::swap(int a, int b){ } void SurfaceStack::draw(){ - ofEnableAlphaBlending(); for(int i = 0; i < _surfaces.size(); ++i){ + if(_surfaces[i]->getSource()->getType() == SourceType::SOURCE_TYPE_FBO){ + glEnable(GL_BLEND); + glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + }else{ + ofEnableAlphaBlending(); + } + _surfaces[i]->draw(); } }