I've just seen a texture example which contains the code:
GLubyte pixels[4 * 3] =
{
255, 0, 0, // Red
0, 255, 0, // Green
0, 0, 255, // Blue
255, 255, 0 // Yellow
};
// Use tightly packed data.
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
Wouldn't it be better to additionally store one padding component per pixel, and specify 4-byte alignment?
I'm asking out of interest in performance.
Many thanks