+ guint8 r;
+ guint8 g;
+ guint8 b;
+ guint8 a;
I would recommend against this approach, instead, use
guint8 rgba[4];
and replace
+ _vertices[i].r = pixels[0];
+ _vertices[i].g = pixels[1];
+ _vertices[i].b = pixels[2];
+ _vertices[i].a = pixels[3];
with
for (int p = 0; p < 4; p++) {
_vertices[i].rgba[p] = pixels[p];
}
It generally ends up being less work and less error prone.