Browse Source

OpenGLContext: Re-bind previous program after copying texture

v7.0.9
reuk 2 years ago
parent
commit
9bf785f221
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      modules/juce_opengl/opengl/juce_OpenGLContext.cpp

+ 5
- 0
modules/juce_opengl/opengl/juce_OpenGLContext.cpp View File

@@ -1607,6 +1607,11 @@ void OpenGLContext::copyTexture (const Rectangle<int>& targetClipArea,
auto bottom = (GLshort) targetClipArea.getBottom();
const GLshort vertices[] = { left, bottom, right, bottom, left, top, right, top };
GLint oldProgram{};
glGetIntegerv (GL_CURRENT_PROGRAM, &oldProgram);
const ScopeGuard bindPreviousProgram { [&] { extensions.glUseProgram ((GLuint) oldProgram); } };
auto& program = OverlayShaderProgram::select (*this);
program.params.set ((float) contextWidth, (float) contextHeight, anchorPosAndTextureSize.toFloat(), flippedVertically);


Loading…
Cancel
Save