1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00

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.
This commit is contained in:
Jelle Raaijmakers 2021-12-21 00:57:57 +01:00 committed by Brian Gianforcaro
parent 604eea5827
commit a1fb16e89c

View file

@ -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