From: Mikko Rasa Date: Wed, 10 Nov 2021 14:13:09 +0000 (+0200) Subject: Remove the LINE_LOOP primitive type X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=66e4a4d23d114e49743af89e06dee8bdc6f1fbde Remove the LINE_LOOP primitive type It's not supported on Vulkan and can be replaced by LINE_STRIP by adding one extra index at the end. --- diff --git a/source/backends/opengl/primitivetype_backend.cpp b/source/backends/opengl/primitivetype_backend.cpp index 7e92fc1e..42ee9f26 100644 --- a/source/backends/opengl/primitivetype_backend.cpp +++ b/source/backends/opengl/primitivetype_backend.cpp @@ -14,7 +14,6 @@ unsigned get_gl_primitive_type(PrimitiveType pt) case POINTS: return GL_POINTS; case LINES: return GL_LINES; case LINE_STRIP: return GL_LINE_STRIP; - case LINE_LOOP: return GL_LINE_LOOP; case TRIANGLES: return GL_TRIANGLES; case TRIANGLE_STRIP: return GL_TRIANGLE_STRIP; case TRIANGLE_FAN: return GL_TRIANGLE_FAN; diff --git a/source/core/batch.cpp b/source/core/batch.cpp index 9192b673..9639a320 100644 --- a/source/core/batch.cpp +++ b/source/core/batch.cpp @@ -106,7 +106,7 @@ bool Batch::can_append(PrimitiveType other_type) { if(other_type!=prim_type) return false; - else if(prim_type==LINE_STRIP || prim_type==LINE_LOOP || prim_type==TRIANGLE_FAN) + else if(prim_type==LINE_STRIP || prim_type==TRIANGLE_FAN) return check_restart(false); else return true; @@ -116,7 +116,7 @@ Batch &Batch::append(const Batch &other) { if(other.prim_type!=prim_type) throw invalid_argument("Batch::append"); - if(prim_type==LINE_STRIP || prim_type==LINE_LOOP || prim_type==TRIANGLE_FAN) + if(prim_type==LINE_STRIP || prim_type==TRIANGLE_FAN) check_restart(true); if(other.data.empty()) diff --git a/source/core/primitivetype.cpp b/source/core/primitivetype.cpp index e52a87dc..7698e2d6 100644 --- a/source/core/primitivetype.cpp +++ b/source/core/primitivetype.cpp @@ -12,8 +12,6 @@ void operator>>(const LexicalConverter &conv, PrimitiveType &pt) pt = POINTS; else if(conv.get()=="LINES") pt = LINES; - else if(conv.get()=="LINE_LOOP") - pt = LINE_LOOP; else if(conv.get()=="LINE_STRIP") pt = LINE_STRIP; else if(conv.get()=="TRIANGLES") diff --git a/source/core/primitivetype.h b/source/core/primitivetype.h index 4b6a1a3e..0c566f89 100644 --- a/source/core/primitivetype.h +++ b/source/core/primitivetype.h @@ -11,7 +11,6 @@ enum PrimitiveType POINTS, LINES, LINE_STRIP, - LINE_LOOP, TRIANGLES, TRIANGLE_STRIP, TRIANGLE_FAN