GWN: Add GL_TRIANGLES_ADJACENCY to supported primitive types.
authorClément Foucault <foucault.clem@gmail.com>
Sun, 22 Apr 2018 19:33:58 +0000 (21:33 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Wed, 2 May 2018 18:49:38 +0000 (20:49 +0200)
intern/gawain/gawain/gwn_primitive.h
intern/gawain/src/gwn_primitive.c

index 5e5b801988977f5ffd90bc66757c1340595bc397..efcc67243ad621587be36492d4524724198e5e83 100644 (file)
@@ -22,6 +22,7 @@ typedef enum {
        GWN_PRIM_TRI_STRIP,
        GWN_PRIM_TRI_FAN,
 
+       GWN_PRIM_TRIS_ADJ,
        GWN_PRIM_LINE_STRIP_ADJ,
 
        GWN_PRIM_NONE
index b206b3ae1b3ad2699e8015c566ddc5d27b724098..8ec2a102df197f48df3b5d857e000311d9b6fb84 100644 (file)
@@ -25,6 +25,7 @@ Gwn_PrimClass GWN_primtype_class(Gwn_PrimType prim_type)
                [GWN_PRIM_TRI_FAN] = GWN_PRIM_CLASS_SURFACE,
 
                [GWN_PRIM_LINE_STRIP_ADJ] = GWN_PRIM_CLASS_LINE,
+               [GWN_PRIM_TRIS_ADJ] = GWN_PRIM_CLASS_SURFACE,
 
                [GWN_PRIM_NONE] = GWN_PRIM_CLASS_NONE
                };
@@ -52,11 +53,12 @@ GLenum convert_prim_type_to_gl(Gwn_PrimType prim_type)
                [GWN_PRIM_LINES] = GL_LINES,
                [GWN_PRIM_LINE_STRIP] = GL_LINE_STRIP,
                [GWN_PRIM_LINE_LOOP] = GL_LINE_LOOP,
-               [GWN_PRIM_TRIS] = GWN_PRIM_CLASS_SURFACE,
+               [GWN_PRIM_TRIS] = GL_TRIANGLES,
                [GWN_PRIM_TRI_STRIP] = GL_TRIANGLE_STRIP,
                [GWN_PRIM_TRI_FAN] = GL_TRIANGLE_FAN,
 
                [GWN_PRIM_LINE_STRIP_ADJ] = GL_LINE_STRIP_ADJACENCY,
+               [GWN_PRIM_TRIS_ADJ] = GL_TRIANGLES_ADJACENCY,
                };
 
        return table[prim_type];