mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-02 03:20:06 +00:00
Replaced an old-style GL function call with a newer equivalent.
This commit is contained in:
parent
8d340d587e
commit
7d6ab860fc
1 changed files with 8 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue