mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
OpenGLContext: Re-bind previous program after copying texture
This commit is contained in:
parent
f76799fde2
commit
9bf785f221
1 changed files with 5 additions and 0 deletions
|
|
@ -1607,6 +1607,11 @@ void OpenGLContext::copyTexture (const Rectangle<int>& targetClipArea,
|
||||||
auto bottom = (GLshort) targetClipArea.getBottom();
|
auto bottom = (GLshort) targetClipArea.getBottom();
|
||||||
const GLshort vertices[] = { left, bottom, right, bottom, left, top, right, top };
|
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);
|
auto& program = OverlayShaderProgram::select (*this);
|
||||||
program.params.set ((float) contextWidth, (float) contextHeight, anchorPosAndTextureSize.toFloat(), flippedVertically);
|
program.params.set ((float) contextWidth, (float) contextHeight, anchorPosAndTextureSize.toFloat(), flippedVertically);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue