From a1fb16e89c8f4479b1e78098c4c5cf62137b6d37 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Tue, 21 Dec 2021 00:57:57 +0100 Subject: [PATCH] LibGL: Implement `GL_POLYGON` rendering This is a deprecated feature that is still in use in some older games, most notably Grim Fandango in ScummVM makes heavy use of it. Luckily, since you can only draw convex polygons, the end result is exactly the same as when you would have used `glBegin(GL_TRIANGLE_FAN)` - so we just reuse that code as-is. --- Userland/Libraries/LibGL/SoftwareGLContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGL/SoftwareGLContext.cpp b/Userland/Libraries/LibGL/SoftwareGLContext.cpp index e8edfda101..04c2e0f9d3 100644 --- a/Userland/Libraries/LibGL/SoftwareGLContext.cpp +++ b/Userland/Libraries/LibGL/SoftwareGLContext.cpp @@ -256,7 +256,7 @@ void SoftwareGLContext::gl_end() triangle.vertices[2] = vertex_list.at(i); triangle_list.append(triangle); } - } else if (m_current_draw_mode == GL_TRIANGLE_FAN) { + } else if (m_current_draw_mode == GL_TRIANGLE_FAN || m_current_draw_mode == GL_POLYGON) { GLTriangle triangle; triangle.vertices[0] = vertex_list.at(0); // Root vertex is always the vertex defined first