From 8005175ea5d045a3e9a822fda6b037a0e08bc2b2 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Thu, 14 May 2020 10:38:12 +0100 Subject: [PATCH] GLES2 polyline drawn as GL_LINE_STRIP to match GLES3 The behaviour of TYPE_POLYLINE appeared incorrect in GLES2, and inconsistent with GLES3 and the docs, which state that draw_polyline 'Draws interconnected line segments'. Also when drawing with triangles GLES2 draws interconnected segments. This PR simply changes the primitive from GL_LINES to GL_LINE_STRIP as in GLES3. --- drivers/gles2/rasterizer_canvas_gles2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp index c0708c564b1..494f688454f 100644 --- a/drivers/gles2/rasterizer_canvas_gles2.cpp +++ b/drivers/gles2/rasterizer_canvas_gles2.cpp @@ -1526,7 +1526,7 @@ void RasterizerCanvasGLES2::render_batches(Item::Command *const *p_commands, Ite offset += to_draw * 2; } } else { - _draw_generic(GL_LINES, pline->lines.size(), pline->lines.ptr(), NULL, pline->line_colors.ptr(), pline->line_colors.size() == 1); + _draw_generic(GL_LINE_STRIP, pline->lines.size(), pline->lines.ptr(), NULL, pline->line_colors.ptr(), pline->line_colors.size() == 1); } #ifdef GLES_OVER_GL