glReadPixels and Bitmap colors

Hi there,

I use the function glReadPixels to save my successive screens into Bitmap files. But the colors must be inverted from RGB to BGR. I’ve found two solutions in this forum to perform this inversion :

  1. I invert manually the colors by changing the indexes of the color for each pixel.
  2. I use the function glReadPixels with the parameter GL_BGR instead of GL_RGB (proposition of Mr Ryan Sammartino thanks !)

But, I found the first solution heavy and not elegant and the second doesn’t work on my platform (Linux Redhat 7.3).

Does anyone have another solution ?

Thanks in advance.

Tom Tomski.