It could be argued, that after the optimiser had a chance, it won’t make a difference, but how about this change:
for (int i = 0; i < textureWidth * textureHeight * 4; i += 4)
std::swap (pixelData [i], pixelData [i+2]);
It could be argued, that after the optimiser had a chance, it won’t make a difference, but how about this change:
for (int i = 0; i < textureWidth * textureHeight * 4; i += 4)
std::swap (pixelData [i], pixelData [i+2]);