diff -r 8ca9ce569f65 src/render/opengles/SDL_render_gles.c --- a/src/render/opengles/SDL_render_gles.c Sat Jun 28 19:51:26 2014 -0700 +++ b/src/render/opengles/SDL_render_gles.c Mon Jun 30 22:25:41 2014 +0200 @@ -814,12 +814,24 @@ int count) { GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + GLfloat *vertices; + int idx; GLES_SetDrawingState(renderer); - data->glVertexPointer(2, GL_FLOAT, 0, points); + /* Emit the specified vertices as points */ + vertices = SDL_stack_alloc(GLfloat, count * 2); + for (idx = 0; idx < count; ++idx) { + GLfloat x = points[idx].x + 0.5f; + GLfloat y = points[idx].y + 0.5f; + + vertices[idx * 2] = x; + vertices[(idx * 2) + 1] = y; + } + + data->glVertexPointer(2, GL_FLOAT, 0, vertices); data->glDrawArrays(GL_POINTS, 0, count); - + SDL_stack_free(vertices); return 0; } @@ -828,10 +840,22 @@ int count) { GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + GLfloat *vertices; + int idx; GLES_SetDrawingState(renderer); - data->glVertexPointer(2, GL_FLOAT, 0, points); + /* Emit a line strip including the specified vertices */ + vertices = SDL_stack_alloc(GLfloat, count * 2); + for (idx = 0; idx < count; ++idx) { + GLfloat x = points[idx].x + 0.5f; + GLfloat y = points[idx].y + 0.5f; + + vertices[idx * 2] = x; + vertices[(idx * 2) + 1] = y; + } + + data->glVertexPointer(2, GL_FLOAT, 0, vertices); if (count > 2 && points[0].x == points[count-1].x && points[0].y == points[count-1].y) { /* GL_LINE_LOOP takes care of the final segment */ @@ -842,6 +866,7 @@ /* We need to close the endpoint of the line */ data->glDrawArrays(GL_POINTS, count-1, 1); } + SDL_stack_free(vertices); return 0; }