Skip to content
Permalink
Browse files

Merge PR #2356: overlay_gl: call glDrawArrays with GL_TRIANGLES inste…

…ad of GL_QUADS.
  • Loading branch information...
mkrautz committed Jun 23, 2016
2 parents 557dbae + e13d6c9 commit dce83ca911460c55681ef87da8e18c76e32f9bb2
Showing with 21 additions and 7 deletions.
  1. +21 −7 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();
}

0 comments on commit dce83ca

Please sign in to comment.
You can’t perform that action at this time.