| @@ -894,6 +894,27 @@ void OpenGLContext::setAssociatedObject (const char* name, ReferenceCountedObjec | |||||
| void OpenGLContext::setImageCacheSize (size_t newSize) noexcept { imageCacheMaxSize = newSize; } | void OpenGLContext::setImageCacheSize (size_t newSize) noexcept { imageCacheMaxSize = newSize; } | ||||
| size_t OpenGLContext::getImageCacheSize() const noexcept { return imageCacheMaxSize; } | size_t OpenGLContext::getImageCacheSize() const noexcept { return imageCacheMaxSize; } | ||||
| //============================================================================== | |||||
| struct DepthTestDisabler | |||||
| { | |||||
| DepthTestDisabler() noexcept | |||||
| { | |||||
| glGetBooleanv (GL_DEPTH_TEST, &wasEnabled); | |||||
| if (wasEnabled) | |||||
| glDisable (GL_DEPTH_TEST); | |||||
| } | |||||
| ~DepthTestDisabler() noexcept | |||||
| { | |||||
| if (wasEnabled) | |||||
| glEnable (GL_DEPTH_TEST); | |||||
| } | |||||
| GLboolean wasEnabled; | |||||
| }; | |||||
| //============================================================================== | |||||
| void OpenGLContext::copyTexture (const Rectangle<int>& targetClipArea, | void OpenGLContext::copyTexture (const Rectangle<int>& targetClipArea, | ||||
| const Rectangle<int>& anchorPosAndTextureSize, | const Rectangle<int>& anchorPosAndTextureSize, | ||||
| const int contextWidth, const int contextHeight, | const int contextWidth, const int contextHeight, | ||||
| @@ -906,6 +927,8 @@ void OpenGLContext::copyTexture (const Rectangle<int>& targetClipArea, | |||||
| glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); | glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); | ||||
| glEnable (GL_BLEND); | glEnable (GL_BLEND); | ||||
| DepthTestDisabler depthDisabler; | |||||
| if (areShadersAvailable()) | if (areShadersAvailable()) | ||||
| { | { | ||||
| struct OverlayShaderProgram : public ReferenceCountedObject | struct OverlayShaderProgram : public ReferenceCountedObject | ||||