From b3775a75640ae2be0cef489c69d7e4213f170cb9 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 20 Jan 2011 12:29:49 +0000 Subject: [PATCH] cogl: s/Cogl*Vertex/CoglVertex*/ We have a bunch of experimental convenience functions like cogl_primitive_p2/p2t2 that have corresponding vertex structures but it seemed a bit odd to have the vertex annotation e.g. "P2T2" be an infix of the type like CoglP2T2Vertex instead of be a postfix like CoglVertexP2T2. This switches them all to follow the postfix naming style. --- clutter/cogl/cogl/cogl-primitive.c | 96 +++++++++++------------ clutter/cogl/cogl/cogl-primitive.h | 80 +++++++++---------- clutter/cogl/cogl/cogl-vertex-attribute.c | 20 ++--- tests/conform/test-cogl-primitive.c | 16 ++-- 4 files changed, 106 insertions(+), 106 deletions(-) diff --git a/clutter/cogl/cogl/cogl-primitive.c b/clutter/cogl/cogl/cogl-primitive.c index 2edac5f85..cfc45343a 100644 --- a/clutter/cogl/cogl/cogl-primitive.c +++ b/clutter/cogl/cogl/cogl-primitive.c @@ -123,17 +123,17 @@ cogl_primitive_new (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p2 (CoglVerticesMode mode, int n_vertices, - const CoglP2Vertex *data) + const CoglVertexP2 *data) { CoglVertexArray *array = - cogl_vertex_array_new (n_vertices * sizeof (CoglP2Vertex), data); + cogl_vertex_array_new (n_vertices * sizeof (CoglVertexP2), data); CoglVertexAttribute *attributes[2]; attributes[0] = cogl_vertex_attribute_new (array, "cogl_position_in", - sizeof (CoglP2Vertex), - offsetof (CoglP2Vertex, x), + sizeof (CoglVertexP2), + offsetof (CoglVertexP2, x), 2, COGL_VERTEX_ATTRIBUTE_TYPE_FLOAT); attributes[1] = NULL; @@ -147,17 +147,17 @@ cogl_primitive_new_p2 (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p3 (CoglVerticesMode mode, int n_vertices, - const CoglP3Vertex *data) + const CoglVertexP3 *data) { CoglVertexArray *array = - cogl_vertex_array_new (n_vertices * sizeof (CoglP3Vertex), data); + cogl_vertex_array_new (n_vertices * sizeof (CoglVertexP3), data); CoglVertexAttribute *attributes[2]; attributes[0] = cogl_vertex_attribute_new (array, "cogl_position_in", - sizeof (CoglP3Vertex), - offsetof (CoglP3Vertex, x), + sizeof (CoglVertexP3), + offsetof (CoglVertexP3, x), 3, COGL_VERTEX_ATTRIBUTE_TYPE_FLOAT); attributes[1] = NULL; @@ -171,24 +171,24 @@ cogl_primitive_new_p3 (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p2c4 (CoglVerticesMode mode, int n_vertices, - const CoglP2C4Vertex *data) + const CoglVertexP2C4 *data) { CoglVertexArray *array = - cogl_vertex_array_new (n_vertices * sizeof (CoglP2C4Vertex), data); + cogl_vertex_array_new (n_vertices * sizeof (CoglVertexP2C4), data); CoglVertexAttribute *attributes[3]; attributes[0] = cogl_vertex_attribute_new (array, "cogl_position_in", - sizeof (CoglP2C4Vertex), - offsetof (CoglP2C4Vertex, x), + sizeof (CoglVertexP2C4), + offsetof (CoglVertexP2C4, x), 2, COGL_VERTEX_ATTRIBUTE_TYPE_FLOAT); attributes[1] = cogl_vertex_attribute_new (array, "cogl_color_in", - sizeof (CoglP2C4Vertex), - offsetof (CoglP2C4Vertex, r), + sizeof (CoglVertexP2C4), + offsetof (CoglVertexP2C4, r), 4, COGL_VERTEX_ATTRIBUTE_TYPE_UNSIGNED_BYTE); attributes[2] = NULL; @@ -202,24 +202,24 @@ cogl_primitive_new_p2c4 (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p3c4 (CoglVerticesMode mode, int n_vertices, - const CoglP3C4Vertex *data) + const CoglVertexP3C4 *data) { CoglVertexArray *array = - cogl_vertex_array_new (n_vertices * sizeof (CoglP3C4Vertex), data); + cogl_vertex_array_new (n_vertices * sizeof (CoglVertexP3C4), data); CoglVertexAttribute *attributes[3]; attributes[0] = cogl_vertex_attribute_new (array, "cogl_position_in", - sizeof (CoglP3C4Vertex), - offsetof (CoglP3C4Vertex, x), + sizeof (CoglVertexP3C4), + offsetof (CoglVertexP3C4, x), 3, COGL_VERTEX_ATTRIBUTE_TYPE_FLOAT); attributes[1] = cogl_vertex_attribute_new (array, "cogl_color_in", - sizeof (CoglP3C4Vertex), - offsetof (CoglP3C4Vertex, r), + sizeof (CoglVertexP3C4), + offsetof (CoglVertexP3C4, r), 4, COGL_VERTEX_ATTRIBUTE_TYPE_UNSIGNED_BYTE); attributes[2] = NULL; @@ -233,24 +233,24 @@ cogl_primitive_new_p3c4 (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p2t2 (CoglVerticesMode mode, int n_vertices, - const CoglP2T2Vertex *data) + const CoglVertexP2T2 *data) { CoglVertexArray *array = - cogl_vertex_array_new (n_vertices * sizeof (CoglP2T2Vertex), data); + cogl_vertex_array_new (n_vertices * sizeof (CoglVertexP2T2), data); CoglVertexAttribute *attributes[3]; attributes[0] = cogl_vertex_attribute_new (array, "cogl_position_in", - sizeof (CoglP2T2Vertex), - offsetof (CoglP2T2Vertex, x), + sizeof (CoglVertexP2T2), + offsetof (CoglVertexP2T2, x), 2, COGL_VERTEX_ATTRIBUTE_TYPE_FLOAT); attributes[1] = cogl_vertex_attribute_new (array, "cogl_tex_coord0_in", - sizeof (CoglP2T2Vertex), - offsetof (CoglP2T2Vertex, s), + sizeof (CoglVertexP2T2), + offsetof (CoglVertexP2T2, s), 2, COGL_VERTEX_ATTRIBUTE_TYPE_FLOAT); attributes[2] = NULL; @@ -264,24 +264,24 @@ cogl_primitive_new_p2t2 (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p3t2 (CoglVerticesMode mode, int n_vertices, - const CoglP3T2Vertex *data) + const CoglVertexP3T2 *data) { CoglVertexArray *array = - cogl_vertex_array_new (n_vertices * sizeof (CoglP3T2Vertex), data); + cogl_vertex_array_new (n_vertices * sizeof (CoglVertexP3T2), data); CoglVertexAttribute *attributes[3]; attributes[0] = cogl_vertex_attribute_new (array, "cogl_position_in", - sizeof (CoglP3T2Vertex), - offsetof (CoglP3T2Vertex, x), + sizeof (CoglVertexP3T2), + offsetof (CoglVertexP3T2, x), 3, COGL_VERTEX_ATTRIBUTE_TYPE_FLOAT); attributes[1] = cogl_vertex_attribute_new (array, "cogl_tex_coord0_in", - sizeof (CoglP3T2Vertex), - offsetof (CoglP3T2Vertex, s), + sizeof (CoglVertexP3T2), + offsetof (CoglVertexP3T2, s), 2, COGL_VERTEX_ATTRIBUTE_TYPE_FLOAT); attributes[2] = NULL; @@ -295,31 +295,31 @@ cogl_primitive_new_p3t2 (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p2t2c4 (CoglVerticesMode mode, int n_vertices, - const CoglP2T2C4Vertex *data) + const CoglVertexP2T2C4 *data) { CoglVertexArray *array = - cogl_vertex_array_new (n_vertices * sizeof (CoglP2T2C4Vertex), data); + cogl_vertex_array_new (n_vertices * sizeof (CoglVertexP2T2C4), data); CoglVertexAttribute *attributes[4]; attributes[0] = cogl_vertex_attribute_new (array, "cogl_position_in", - sizeof (CoglP2T2C4Vertex), - offsetof (CoglP2T2C4Vertex, x), + sizeof (CoglVertexP2T2C4), + offsetof (CoglVertexP2T2C4, x), 2, COGL_VERTEX_ATTRIBUTE_TYPE_FLOAT); attributes[1] = cogl_vertex_attribute_new (array, "cogl_tex_coord0_in", - sizeof (CoglP2T2C4Vertex), - offsetof (CoglP2T2C4Vertex, s), + sizeof (CoglVertexP2T2C4), + offsetof (CoglVertexP2T2C4, s), 2, COGL_VERTEX_ATTRIBUTE_TYPE_FLOAT); attributes[2] = cogl_vertex_attribute_new (array, "cogl_color_in", - sizeof (CoglP2T2C4Vertex), - offsetof (CoglP2T2C4Vertex, r), + sizeof (CoglVertexP2T2C4), + offsetof (CoglVertexP2T2C4, r), 4, COGL_VERTEX_ATTRIBUTE_TYPE_UNSIGNED_BYTE); attributes[3] = NULL; @@ -333,31 +333,31 @@ cogl_primitive_new_p2t2c4 (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p3t2c4 (CoglVerticesMode mode, int n_vertices, - const CoglP3T2C4Vertex *data) + const CoglVertexP3T2C4 *data) { CoglVertexArray *array = - cogl_vertex_array_new (n_vertices * sizeof (CoglP3T2C4Vertex), data); + cogl_vertex_array_new (n_vertices * sizeof (CoglVertexP3T2C4), data); CoglVertexAttribute *attributes[4]; attributes[0] = cogl_vertex_attribute_new (array, "cogl_position_in", - sizeof (CoglP3T2C4Vertex), - offsetof (CoglP3T2C4Vertex, x), + sizeof (CoglVertexP3T2C4), + offsetof (CoglVertexP3T2C4, x), 3, COGL_VERTEX_ATTRIBUTE_TYPE_FLOAT); attributes[1] = cogl_vertex_attribute_new (array, "cogl_tex_coord0_in", - sizeof (CoglP3T2C4Vertex), - offsetof (CoglP3T2C4Vertex, s), + sizeof (CoglVertexP3T2C4), + offsetof (CoglVertexP3T2C4, s), 2, COGL_VERTEX_ATTRIBUTE_TYPE_FLOAT); attributes[2] = cogl_vertex_attribute_new (array, "cogl_color_in", - sizeof (CoglP3T2C4Vertex), - offsetof (CoglP3T2C4Vertex, r), + sizeof (CoglVertexP3T2C4), + offsetof (CoglVertexP3T2C4, r), 4, COGL_VERTEX_ATTRIBUTE_TYPE_UNSIGNED_BYTE); attributes[3] = NULL; diff --git a/clutter/cogl/cogl/cogl-primitive.h b/clutter/cogl/cogl/cogl-primitive.h index d2eaa53c9..0f0aeaceb 100644 --- a/clutter/cogl/cogl/cogl-primitive.h +++ b/clutter/cogl/cogl/cogl-primitive.h @@ -47,7 +47,7 @@ G_BEGIN_DECLS typedef struct _CoglPrimitive CoglPrimitive; /** - * CoglP2Vertex: + * CoglVertexP2: * @x: The x component of a position attribute * @y: The y component of a position attribute * @@ -60,10 +60,10 @@ typedef struct _CoglPrimitive CoglPrimitive; typedef struct { float x, y; -} CoglP2Vertex; +} CoglVertexP2; /** - * CoglP3Vertex: + * CoglVertexP3: * @x: The x component of a position attribute * @y: The y component of a position attribute * @z: The z component of a position attribute @@ -77,10 +77,10 @@ typedef struct typedef struct { float x, y, z; -} CoglP3Vertex; +} CoglVertexP3; /** - * CoglP2C4Vertex: + * CoglVertexP2C4: * @x: The x component of a position attribute * @y: The y component of a position attribute * @r: The red component of a color attribute @@ -98,10 +98,10 @@ typedef struct { float x, y; guint8 r, g, b, a; -} CoglP2C4Vertex; +} CoglVertexP2C4; /** - * CoglP3C4Vertex: + * CoglVertexP3C4: * @x: The x component of a position attribute * @y: The y component of a position attribute * @z: The z component of a position attribute @@ -120,10 +120,10 @@ typedef struct { float x, y, z; guint8 r, g, b, a; -} CoglP3C4Vertex; +} CoglVertexP3C4; /** - * CoglP2T2Vertex: + * CoglVertexP2T2: * @x: The x component of a position attribute * @y: The y component of a position attribute * @s: The s component of a texture coordinate attribute @@ -139,10 +139,10 @@ typedef struct { float x, y; float s, t; -} CoglP2T2Vertex; +} CoglVertexP2T2; /** - * CoglP3T2Vertex: + * CoglVertexP3T2: * @x: The x component of a position attribute * @y: The y component of a position attribute * @z: The z component of a position attribute @@ -159,11 +159,11 @@ typedef struct { float x, y, z; float s, t; -} CoglP3T2Vertex; +} CoglVertexP3T2; /** - * CoglP2T2C4Vertex: + * CoglVertexP2T2C4: * @x: The x component of a position attribute * @y: The y component of a position attribute * @s: The s component of a texture coordinate attribute @@ -184,10 +184,10 @@ typedef struct float x, y; float s, t; guint8 r, g, b, a; -} CoglP2T2C4Vertex; +} CoglVertexP2T2C4; /** - * CoglP3T2C4Vertex: + * CoglVertexP3T2C4: * @x: The x component of a position attribute * @y: The y component of a position attribute * @z: The z component of a position attribute @@ -209,7 +209,7 @@ typedef struct float x, y, z; float s, t; guint8 r, g, b, a; -} CoglP3T2C4Vertex; +} CoglVertexP3T2C4; /** * cogl_primitive_new: @@ -241,7 +241,7 @@ cogl_primitive_new_with_attributes_array (CoglVerticesMode mode, * cogl_primitive_new_p2: * @mode: A #CoglVerticesMode defining how to draw the vertices * @n_vertices: The number of vertices to process when drawing - * @data: An array of #CoglP2Vertex vertices + * @data: An array of #CoglVertexP2 vertices * * Provides a convenient way to describe a primitive, such as a single * triangle strip or a triangle fan, that will internally allocate the @@ -250,7 +250,7 @@ cogl_primitive_new_with_attributes_array (CoglVerticesMode mode, * * For example to draw a convex polygon you can do: * |[ - * CoglP2Vertex triangle[] = + * CoglVertexP2 triangle[] = * { * { 0, 300 }, * { 150, 0, }, @@ -279,13 +279,13 @@ cogl_primitive_new_with_attributes_array (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p2 (CoglVerticesMode mode, int n_vertices, - const CoglP2Vertex *data); + const CoglVertexP2 *data); /** * cogl_primitive_new_p3: * @mode: A #CoglVerticesMode defining how to draw the vertices * @n_vertices: The number of vertices to process when drawing - * @data: An array of #CoglP3Vertex vertices + * @data: An array of #CoglVertexP3 vertices * * Provides a convenient way to describe a primitive, such as a single * triangle strip or a triangle fan, that will internally allocate the @@ -294,7 +294,7 @@ cogl_primitive_new_p2 (CoglVerticesMode mode, * * For example to draw a convex polygon you can do: * |[ - * CoglP3Vertex triangle[] = + * CoglVertexP3 triangle[] = * { * { 0, 300, 0 }, * { 150, 0, 0 }, @@ -323,13 +323,13 @@ cogl_primitive_new_p2 (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p3 (CoglVerticesMode mode, int n_vertices, - const CoglP3Vertex *data); + const CoglVertexP3 *data); /** * cogl_primitive_new_p2c4: * @mode: A #CoglVerticesMode defining how to draw the vertices * @n_vertices: The number of vertices to process when drawing - * @data: An array of #CoglP2C4Vertex vertices + * @data: An array of #CoglVertexP2C4 vertices * * Provides a convenient way to describe a primitive, such as a single * triangle strip or a triangle fan, that will internally allocate the @@ -340,7 +340,7 @@ cogl_primitive_new_p3 (CoglVerticesMode mode, * For example to draw a convex polygon with a linear gradient you * can do: * |[ - * CoglP2C4Vertex triangle[] = + * CoglVertexP2C4 triangle[] = * { * { 0, 300, 0xff, 0x00, 0x00, 0xff }, * { 150, 0, 0x00, 0xff, 0x00, 0xff }, @@ -369,13 +369,13 @@ cogl_primitive_new_p3 (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p2c4 (CoglVerticesMode mode, int n_vertices, - const CoglP2C4Vertex *data); + const CoglVertexP2C4 *data); /** * cogl_primitive_new_p3c4: * @mode: A #CoglVerticesMode defining how to draw the vertices * @n_vertices: The number of vertices to process when drawing - * @data: An array of #CoglP3C4Vertex vertices + * @data: An array of #CoglVertexP3C4 vertices * * Provides a convenient way to describe a primitive, such as a single * triangle strip or a triangle fan, that will internally allocate the @@ -386,7 +386,7 @@ cogl_primitive_new_p2c4 (CoglVerticesMode mode, * For example to draw a convex polygon with a linear gradient you * can do: * |[ - * CoglP3C4Vertex triangle[] = + * CoglVertexP3C4 triangle[] = * { * { 0, 300, 0, 0xff, 0x00, 0x00, 0xff }, * { 150, 0, 0, 0x00, 0xff, 0x00, 0xff }, @@ -415,13 +415,13 @@ cogl_primitive_new_p2c4 (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p3c4 (CoglVerticesMode mode, int n_vertices, - const CoglP3C4Vertex *data); + const CoglVertexP3C4 *data); /** * cogl_primitive_new_p2t2: * @mode: A #CoglVerticesMode defining how to draw the vertices * @n_vertices: The number of vertices to process when drawing - * @data: An array of #CoglP2T2Vertex vertices + * @data: An array of #CoglVertexP2T2 vertices * * Provides a convenient way to describe a primitive, such as a single * triangle strip or a triangle fan, that will internally allocate the @@ -432,7 +432,7 @@ cogl_primitive_new_p3c4 (CoglVerticesMode mode, * For example to draw a convex polygon with texture mapping you can * do: * |[ - * CoglP2T2Vertex triangle[] = + * CoglVertexP2T2 triangle[] = * { * { 0, 300, 0.0, 1.0}, * { 150, 0, 0.5, 0.0}, @@ -461,13 +461,13 @@ cogl_primitive_new_p3c4 (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p2t2 (CoglVerticesMode mode, int n_vertices, - const CoglP2T2Vertex *data); + const CoglVertexP2T2 *data); /** * cogl_primitive_new_p3t2: * @mode: A #CoglVerticesMode defining how to draw the vertices * @n_vertices: The number of vertices to process when drawing - * @data: An array of #CoglP3T2Vertex vertices + * @data: An array of #CoglVertexP3T2 vertices * * Provides a convenient way to describe a primitive, such as a single * triangle strip or a triangle fan, that will internally allocate the @@ -478,7 +478,7 @@ cogl_primitive_new_p2t2 (CoglVerticesMode mode, * For example to draw a convex polygon with texture mapping you can * do: * |[ - * CoglP3T2Vertex triangle[] = + * CoglVertexP3T2 triangle[] = * { * { 0, 300, 0, 0.0, 1.0}, * { 150, 0, 0, 0.5, 0.0}, @@ -507,13 +507,13 @@ cogl_primitive_new_p2t2 (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p3t2 (CoglVerticesMode mode, int n_vertices, - const CoglP3T2Vertex *data); + const CoglVertexP3T2 *data); /** * cogl_primitive_new_p2t2c4: * @mode: A #CoglVerticesMode defining how to draw the vertices * @n_vertices: The number of vertices to process when drawing - * @data: An array of #CoglP2T2C4Vertex vertices + * @data: An array of #CoglVertexP2T2C4 vertices * * Provides a convenient way to describe a primitive, such as a single * triangle strip or a triangle fan, that will internally allocate the @@ -524,7 +524,7 @@ cogl_primitive_new_p3t2 (CoglVerticesMode mode, * For example to draw a convex polygon with texture mapping and a * linear gradient you can do: * |[ - * CoglP2T2C4Vertex triangle[] = + * CoglVertexP2T2C4 triangle[] = * { * { 0, 300, 0.0, 1.0, 0xff, 0x00, 0x00, 0xff}, * { 150, 0, 0.5, 0.0, 0x00, 0xff, 0x00, 0xff}, @@ -553,13 +553,13 @@ cogl_primitive_new_p3t2 (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p2t2c4 (CoglVerticesMode mode, int n_vertices, - const CoglP2T2C4Vertex *data); + const CoglVertexP2T2C4 *data); /** * cogl_primitive_new_p3t2c4: * @mode: A #CoglVerticesMode defining how to draw the vertices * @n_vertices: The number of vertices to process when drawing - * @data: An array of #CoglP3T2C4Vertex vertices + * @data: An array of #CoglVertexP3T2C4 vertices * * Provides a convenient way to describe a primitive, such as a single * triangle strip or a triangle fan, that will internally allocate the @@ -570,7 +570,7 @@ cogl_primitive_new_p2t2c4 (CoglVerticesMode mode, * For example to draw a convex polygon with texture mapping and a * linear gradient you can do: * |[ - * CoglP3T2C4Vertex triangle[] = + * CoglVertexP3T2C4 triangle[] = * { * { 0, 300, 0, 0.0, 1.0, 0xff, 0x00, 0x00, 0xff}, * { 150, 0, 0, 0.5, 0.0, 0x00, 0xff, 0x00, 0xff}, @@ -599,7 +599,7 @@ cogl_primitive_new_p2t2c4 (CoglVerticesMode mode, CoglPrimitive * cogl_primitive_new_p3t2c4 (CoglVerticesMode mode, int n_vertices, - const CoglP3T2C4Vertex *data); + const CoglVertexP3T2C4 *data); int cogl_primitive_get_first_vertex (CoglPrimitive *primitive); diff --git a/clutter/cogl/cogl/cogl-vertex-attribute.c b/clutter/cogl/cogl/cogl-vertex-attribute.c index 37ff0a1f9..7bf306dc7 100644 --- a/clutter/cogl/cogl/cogl-vertex-attribute.c +++ b/clutter/cogl/cogl/cogl-vertex-attribute.c @@ -845,7 +845,7 @@ add_line (void *vertices, CoglVertexAttribute *attribute, int start, int end, - CoglP3Vertex *lines, + CoglVertexP3 *lines, int *n_line_vertices) { int start_index = get_index (indices, indices_type, start); @@ -868,7 +868,7 @@ add_line (void *vertices, *n_line_vertices += 2; } -static CoglP3Vertex * +static CoglVertexP3 * get_wire_lines (CoglVertexAttribute *attribute, CoglVerticesMode mode, int n_vertices_in, @@ -882,7 +882,7 @@ get_wire_lines (CoglVertexAttribute *attribute, CoglIndicesType indices_type; int i; int n_lines; - CoglP3Vertex *out; + CoglVertexP3 *out; vertices = cogl_buffer_map (COGL_BUFFER (vertex_array), COGL_BUFFER_ACCESS_READ, 0); @@ -902,7 +902,7 @@ get_wire_lines (CoglVertexAttribute *attribute, (n_vertices_in % 3) == 0) { n_lines = n_vertices_in; - out = g_new (CoglP3Vertex, n_lines * 2); + out = g_new (CoglVertexP3, n_lines * 2); for (i = 0; i < n_vertices_in; i += 3) { add_line (vertices, indices, indices_type, attribute, @@ -917,7 +917,7 @@ get_wire_lines (CoglVertexAttribute *attribute, n_vertices_in >= 3) { n_lines = 2 * n_vertices_in - 3; - out = g_new (CoglP3Vertex, n_lines * 2); + out = g_new (CoglVertexP3, n_lines * 2); add_line (vertices, indices, indices_type, attribute, 0, 1, out, n_vertices_out); @@ -938,7 +938,7 @@ get_wire_lines (CoglVertexAttribute *attribute, n_vertices_in >= 3) { n_lines = 2 * n_vertices_in - 3; - out = g_new (CoglP3Vertex, n_lines * 2); + out = g_new (CoglVertexP3, n_lines * 2); add_line (vertices, indices, indices_type, attribute, 0, 1, out, n_vertices_out); @@ -961,7 +961,7 @@ get_wire_lines (CoglVertexAttribute *attribute, else if (mode == GL_QUADS && (n_vertices_in % 4) == 0) { n_lines = n_vertices_in; - out = g_new (CoglP3Vertex, n_lines * 2); + out = g_new (CoglVertexP3, n_lines * 2); for (i = 0; i < n_vertices_in; i += 4) { @@ -996,7 +996,7 @@ draw_wireframe (CoglVerticesMode mode, int n_line_vertices; static CoglPipeline *wire_pipeline; CoglVertexAttribute *wire_attribute[2]; - CoglP3Vertex *lines; + CoglVertexP3 *lines; CoglVertexArray *array; for (i = 0; attributes[i]; i++) @@ -1015,11 +1015,11 @@ draw_wireframe (CoglVerticesMode mode, n_vertices, &n_line_vertices, indices); - array = cogl_vertex_array_new (sizeof (CoglP3Vertex) * n_line_vertices, + array = cogl_vertex_array_new (sizeof (CoglVertexP3) * n_line_vertices, lines); wire_attribute[0] = cogl_vertex_attribute_new (array, "cogl_position_in", - sizeof (CoglP3Vertex), + sizeof (CoglVertexP3), 0, 3, COGL_VERTEX_ATTRIBUTE_TYPE_FLOAT); diff --git a/tests/conform/test-cogl-primitive.c b/tests/conform/test-cogl-primitive.c index d901de5bb..649ab81c3 100644 --- a/tests/conform/test-cogl-primitive.c +++ b/tests/conform/test-cogl-primitive.c @@ -12,7 +12,7 @@ typedef CoglPrimitive * (* TestPrimFunc) (ClutterColor *expected_color); static CoglPrimitive * test_prim_p2 (ClutterColor *expected_color) { - static const CoglP2Vertex verts[] = + static const CoglVertexP2 verts[] = { { 0, 0 }, { 0, 10 }, { 10, 0 } }; return cogl_primitive_new_p2 (COGL_VERTICES_MODE_TRIANGLES, @@ -23,7 +23,7 @@ test_prim_p2 (ClutterColor *expected_color) static CoglPrimitive * test_prim_p3 (ClutterColor *expected_color) { - static const CoglP3Vertex verts[] = + static const CoglVertexP3 verts[] = { { 0, 0, 0 }, { 0, 10, 0 }, { 10, 0, 0 } }; return cogl_primitive_new_p3 (COGL_VERTICES_MODE_TRIANGLES, @@ -34,7 +34,7 @@ test_prim_p3 (ClutterColor *expected_color) static CoglPrimitive * test_prim_p2c4 (ClutterColor *expected_color) { - static const CoglP2C4Vertex verts[] = + static const CoglVertexP2C4 verts[] = { { 0, 0, 255, 255, 0, 255 }, { 0, 10, 255, 255, 0, 255 }, { 10, 0, 255, 255, 0, 255 } }; @@ -51,7 +51,7 @@ test_prim_p2c4 (ClutterColor *expected_color) static CoglPrimitive * test_prim_p3c4 (ClutterColor *expected_color) { - static const CoglP3C4Vertex verts[] = + static const CoglVertexP3C4 verts[] = { { 0, 0, 0, 255, 255, 0, 255 }, { 0, 10, 0, 255, 255, 0, 255 }, { 10, 0, 0, 255, 255, 0, 255 } }; @@ -68,7 +68,7 @@ test_prim_p3c4 (ClutterColor *expected_color) static CoglPrimitive * test_prim_p2t2 (ClutterColor *expected_color) { - static const CoglP2T2Vertex verts[] = + static const CoglVertexP2T2 verts[] = { { 0, 0, 1, 0 }, { 0, 10, 1, 0 }, { 10, 0, 1, 0 } }; @@ -83,7 +83,7 @@ test_prim_p2t2 (ClutterColor *expected_color) static CoglPrimitive * test_prim_p3t2 (ClutterColor *expected_color) { - static const CoglP3T2Vertex verts[] = + static const CoglVertexP3T2 verts[] = { { 0, 0, 0, 1, 0 }, { 0, 10, 0, 1, 0 }, { 10, 0, 0, 1, 0 } }; @@ -98,7 +98,7 @@ test_prim_p3t2 (ClutterColor *expected_color) static CoglPrimitive * test_prim_p2t2c4 (ClutterColor *expected_color) { - static const CoglP2T2C4Vertex verts[] = + static const CoglVertexP2T2C4 verts[] = { { 0, 0, 1, 0, 0xff, 0xff, 0xf0, 0xff }, { 0, 10, 1, 0, 0xff, 0xff, 0xf0, 0xff }, { 10, 0, 1, 0, 0xff, 0xff, 0xf0, 0xff } }; @@ -114,7 +114,7 @@ test_prim_p2t2c4 (ClutterColor *expected_color) static CoglPrimitive * test_prim_p3t2c4 (ClutterColor *expected_color) { - static const CoglP3T2C4Vertex verts[] = + static const CoglVertexP3T2C4 verts[] = { { 0, 0, 0, 1, 0, 0xff, 0xff, 0xf0, 0xff }, { 0, 10, 0, 1, 0, 0xff, 0xff, 0xf0, 0xff }, { 10, 0, 0, 1, 0, 0xff, 0xff, 0xf0, 0xff } };