Código
typedef struct { float coord[3]; } vec3; ... vec3 vertices[4] = { {-size, -size, 0.0f}, { size, -size, 0.0f}, {-size, size, 0.0f}, { size, size, 0.0f} };
Pero el compilador me lanza los siguientes avisos:
Código:
../src/model.c: In function ‘load_quad’:
../src/model.c:8:9: warning: missing braces around initializer [-Wmissing-braces]
{-size, -size, 0.0f},
^
../src/model.c:8:9: note: (near initialization for ‘vertices[0]’)
../src/model.c:9:9: warning: missing braces around initializer [-Wmissing-braces]
{ size, -size, 0.0f},
^
../src/model.c:9:9: note: (near initialization for ‘vertices[1]’)
../src/model.c:10:9: warning: missing braces around initializer [-Wmissing-braces]
{-size, size, 0.0f},
^
../src/model.c:10:9: note: (near initialization for ‘vertices[2]’)
../src/model.c:11:9: warning: missing braces around initializer [-Wmissing-braces]
{ size, size, 0.0f}
^
../src/model.c:11:9: note: (near initialization for ‘vertices[3]’)
../src/model.c:7:24: warning: missing braces around initializer [-Wmissing-braces]
vec3 vertices[4] = {
^
../src/model.c:7:24: note: (near initialization for ‘vertices’)
Querría saber como initcializar adecuadamente ese arreglo. Muchas gracias