From 20f5167d278d5849a9f6debafb91358867acad5f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 20 Oct 2013 10:35:51 -0700 Subject: [PATCH] Use vertex arrays for drawing points in addition to lines --- src/render/opengl/SDL_render_gl.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index 2c219eea0..51fc9ad73 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -1048,15 +1048,17 @@ GL_RenderDrawPoints(SDL_Renderer * renderer, const SDL_FPoint * points, int count) { GL_RenderData *data = (GL_RenderData *) renderer->driverdata; - int i; GL_SetDrawingState(renderer); - data->glBegin(GL_POINTS); - for (i = 0; i < count; ++i) { - data->glVertex2f(0.5f + points[i].x, 0.5f + points[i].y); - } - data->glEnd(); + data->glTranslatef(0.5f, 0.5f, 0.0f); + data->glVertexPointer(2, GL_FLOAT, 0, points); + data->glEnableClientState(GL_VERTEX_ARRAY); + + data->glDrawArrays(GL_POINTS, 0, count); + + data->glDisableClientState(GL_VERTEX_ARRAY); + data->glTranslatef(-0.5f, -0.5f, 0.0f); return 0; }