diff options
author | Mikkel Krautz <mikkel@krautz.dk> | 2016-06-24 00:07:29 +0300 |
---|---|---|
committer | Mikkel Krautz <mikkel@krautz.dk> | 2016-06-24 00:07:29 +0300 |
commit | dce83ca911460c55681ef87da8e18c76e32f9bb2 (patch) | |
tree | edafc6d0c9060422abbc1932a49c600219eb1aba /overlay_gl | |
parent | 557dbae4c18bd09b4a38ace0c7ead0f110e9413b (diff) | |
parent | e13d6c94bf9a58330a01c0f85d7ed0d0dd0fb6fd (diff) |
Merge PR #2356: overlay_gl: call glDrawArrays with GL_TRIANGLES instead of GL_QUADS.
Diffstat (limited to 'overlay_gl')
-rw-r--r-- | overlay_gl/overlay.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/overlay_gl/overlay.c b/overlay_gl/overlay.c index 12d9d1f35..fe3782d5c 100644 --- a/overlay_gl/overlay.c +++ b/overlay_gl/overlay.c @@ -468,15 +468,29 @@ static void drawOverlay(Context *ctx, unsigned int width, unsigned int height) { float xmx = right / w; float ymx = bottom / h; - - GLfloat vertex[] = {left, bottom, - left, top, - right, top, - right, bottom}; - GLfloat tex[] = {xm, ymx, xm, ym, xmx, ym, xmx, ymx}; + GLfloat vertex[] = { + left, bottom, + left, top, + right, top, + + left, bottom, + right, top, + right, bottom + }; glVertexPointer(2, GL_FLOAT, 0, vertex); + + GLfloat tex[] = { + xm, ymx, + xm, ym, + xmx, ym, + + xm, ymx, + xmx, ym, + xmx, ymx + }; glTexCoordPointer(2, GL_FLOAT, 0, tex); - glDrawArrays(GL_QUADS, 0, 4); + + glDrawArrays(GL_TRIANGLES, 0, 6); glPopMatrix(); } |