Browse Source

Replaced an old-style GL function call with a newer equivalent.

tags/2021-05-28
jules 11 years ago
parent
commit
7d6ab860fc
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      modules/juce_opengl/opengl/juce_OpenGLContext.cpp

+ 8
- 1
modules/juce_opengl/opengl/juce_OpenGLContext.cpp View File

@@ -854,15 +854,22 @@ void OpenGLContext::copyTexture (const Rectangle<int>& targetClipArea,
const OverlayShaderProgram& program = OverlayShaderProgram::select (*this);
program.params.set ((float) contextWidth, (float) contextHeight, anchorPosAndTextureSize.toFloat(), flippedVertically);
GLuint vertexBuffer = 0;
extensions.glGenBuffers (1, &vertexBuffer);
extensions.glBindBuffer (GL_ARRAY_BUFFER, vertexBuffer);
extensions.glBufferData (GL_ARRAY_BUFFER, sizeof (vertices), vertices, GL_STATIC_DRAW);
const GLuint index = (GLuint) program.params.positionAttribute.attributeID;
extensions.glVertexAttribPointer (index, 2, GL_SHORT, GL_FALSE, 4, vertices);
extensions.glVertexAttribPointer (index, 2, GL_SHORT, GL_FALSE, 4, 0);
extensions.glEnableVertexAttribArray (index);
JUCE_CHECK_OPENGL_ERROR
glDrawArrays (GL_TRIANGLE_STRIP, 0, 4);
extensions.glBindBuffer (GL_ARRAY_BUFFER, 0);
extensions.glUseProgram (0);
extensions.glDisableVertexAttribArray (index);
extensions.glDeleteBuffers (1, &vertexBuffer);
}
#if JUCE_USE_OPENGL_FIXED_FUNCTION
else


Loading…
Cancel
Save