From d9ea1fe4c9156cf33a973174f8f0ac17c76358e9 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Mon, 27 Dec 2021 01:23:44 +0100 Subject: LibGL: Implement `GL_QUAD_STRIP` It seems like we can render this with `GL_TRIANGLE_STRIP`. This makes the track marks in Tux Racer work. --- Userland/Libraries/LibGL/SoftwareGLContext.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Userland') diff --git a/Userland/Libraries/LibGL/SoftwareGLContext.cpp b/Userland/Libraries/LibGL/SoftwareGLContext.cpp index 622474bbd0..d5a87f75b3 100644 --- a/Userland/Libraries/LibGL/SoftwareGLContext.cpp +++ b/Userland/Libraries/LibGL/SoftwareGLContext.cpp @@ -244,6 +244,7 @@ void SoftwareGLContext::gl_end() && m_current_draw_mode != GL_TRIANGLE_FAN && m_current_draw_mode != GL_TRIANGLE_STRIP && m_current_draw_mode != GL_QUADS + && m_current_draw_mode != GL_QUAD_STRIP && m_current_draw_mode != GL_POLYGON) { m_vertex_list.clear_with_capacity(); @@ -265,6 +266,7 @@ void SoftwareGLContext::gl_end() primitive_type = SoftGPU::PrimitiveType::Triangles; break; case GL_TRIANGLE_STRIP: + case GL_QUAD_STRIP: primitive_type = SoftGPU::PrimitiveType::TriangleStrip; break; case GL_TRIANGLE_FAN: @@ -1981,11 +1983,12 @@ void SoftwareGLContext::gl_draw_arrays(GLenum mode, GLint first, GLsizei count) APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_draw_arrays, mode, first, count); RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION); - // FIXME: Some modes are still missing (GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES,GL_QUAD_STRIP) + // FIXME: Some modes are still missing (GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES) RETURN_WITH_ERROR_IF(!(mode == GL_TRIANGLE_STRIP || mode == GL_TRIANGLE_FAN || mode == GL_TRIANGLES || mode == GL_QUADS + || mode == GL_QUAD_STRIP || mode == GL_POLYGON), GL_INVALID_ENUM); @@ -2022,11 +2025,12 @@ void SoftwareGLContext::gl_draw_elements(GLenum mode, GLsizei count, GLenum type APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_draw_elements, mode, count, type, indices); RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION); - // FIXME: Some modes are still missing (GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES,GL_QUAD_STRIP) + // FIXME: Some modes are still missing (GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES) RETURN_WITH_ERROR_IF(!(mode == GL_TRIANGLE_STRIP || mode == GL_TRIANGLE_FAN || mode == GL_TRIANGLES || mode == GL_QUADS + || mode == GL_QUAD_STRIP || mode == GL_POLYGON), GL_INVALID_ENUM); -- cgit v1.2.3