]> git.tdb.fi Git - libs/gl.git/commitdiff
Remove the LINE_LOOP primitive type
authorMikko Rasa <tdb@tdb.fi>
Wed, 10 Nov 2021 14:13:09 +0000 (16:13 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 10 Nov 2021 14:13:09 +0000 (16:13 +0200)
It's not supported on Vulkan and can be replaced by LINE_STRIP by adding
one extra index at the end.

source/backends/opengl/primitivetype_backend.cpp
source/core/batch.cpp
source/core/primitivetype.cpp
source/core/primitivetype.h

index 7e92fc1e27c45a1b36877a3419f255e4c0e5cab4..42ee9f26ac73196d50a915825d549f92d07db936 100644 (file)
@@ -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;
index 9192b6738c938125058e7e19f2ea4e77e8eae38a..9639a3207e4b71bc265520fd9a5f096357d8361c 100644 (file)
@@ -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())
index e52a87dc9c3269da2abd4c149cd7303a5d846008..7698e2d65e0fcf916cfb70d4ac228e60830a1f97 100644 (file)
@@ -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")
index 4b6a1a3eeb6cdc2130cabdf5824deab599e642d8..0c566f895b6d5cbd02a3b74060729637520322f0 100644 (file)
@@ -11,7 +11,6 @@ enum PrimitiveType
        POINTS,
        LINES,
        LINE_STRIP,
-       LINE_LOOP,
        TRIANGLES,
        TRIANGLE_STRIP,
        TRIANGLE_FAN