diff --git a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp index 482536916b..88b80ffef8 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp @@ -1525,14 +1525,22 @@ struct DepthTestDisabler void OpenGLContext::copyTexture (const Rectangle& targetClipArea, const Rectangle& anchorPosAndTextureSize, const int contextWidth, const int contextHeight, - bool flippedVertically) + bool flippedVertically, + bool blend) { if (contextWidth <= 0 || contextHeight <= 0) return; JUCE_CHECK_OPENGL_ERROR - glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - glEnable (GL_BLEND); + if (blend) + { + glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + glEnable (GL_BLEND); + } + else + { + glDisable (GL_BLEND); + } DepthTestDisabler depthDisabler; diff --git a/modules/juce_opengl/opengl/juce_OpenGLContext.h b/modules/juce_opengl/opengl/juce_OpenGLContext.h index 763e160967..b85cc556b3 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLContext.h +++ b/modules/juce_opengl/opengl/juce_OpenGLContext.h @@ -332,8 +332,8 @@ public: void copyTexture (const Rectangle& targetClipArea, const Rectangle& anchorPosAndTextureSize, int contextWidth, int contextHeight, - bool textureOriginIsBottomLeft); - + bool textureOriginIsBottomLeft, + bool blend = true); /** Changes the amount of GPU memory that the internal cache for Images is allowed to use. */ void setImageCacheSize (size_t cacheSizeBytes) noexcept; diff --git a/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp b/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp index f4edf250ec..32fcad960c 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp @@ -356,7 +356,7 @@ bool OpenGLFrameBuffer::writePixels (const PixelARGB* data, const Rectangle glViewport (0, 0, pimpl->width, pimpl->height); pimpl->context.copyTexture (area, Rectangle (area.getX(), area.getY(), tex.getWidth(), tex.getHeight()), - pimpl->width, pimpl->height, true); + pimpl->width, pimpl->height, true, false); JUCE_CHECK_OPENGL_ERROR return true;