   colour problems porting from linux to mac
  Hi,I started an SDL plus OpenGL game with ubuntu Linux, and what I did went well. I have revived it on a new Mac. Unfortunately, it doesn't work correctly on the Mac, and I don't know why.Some of my graphics are drawn in the wrong colour. All my graphics are PNGs with an alpha layer. The background is drawn correctly as textured tiles. On top of that there are some tree tiles, also with correct colours. There is a tank, controlled by the player, also drawn correctly, and the player can shoot missiles, again all correct. But the explosions generated when the player's missile detonates are on the wrong colour. And the enemy aircraft is also drawn in the wrong colour (blue instead of brown). I checked the aircraft PNG in the executable, which contains several sprites, and the whole colour scheme is wrong, with apparently no red tones, which would account for the aircraft having no brown.At first, I thought I had an endianness problem, so I messed with the 32 bit pixels and reconstructed them in different byte orders. No good. I managed to mess up all images that way. I think I'm on the wrong track because some graphics work and some don't, and they all have an alpha layer. I think most images originated on linux, except for the explosions, which came from Windows, and the aircraft images came from the web (probably Windows too). Also, all the graphics display fine with GIMP on the Mac. It seems that the wrong-coloured images all originated from Windows, so maybe the endianness is wrong with them and ok with the other images. Finally, I have changed the screen bytes-per-pixel from 32 to 24 or 16 and that makes no difference. Any ideas?Cheers,Andrew.   
  hi AndrewI had a similar problem than yours. The issue is that windows uses BGRA pixel format, so you need to take care of this.You say that you have tried with different pixel formats, but just to give you a solution, have you tried with different GL formats?Quote:i had some problems like yours. And i solved them trying different formats in this function:glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, final_image->w, final_image->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, final_image->pixels);You need to change GL_RGBA parameters: try for example GL_RGBA for the first and GL_BGRA for the second. It depends if your system it's big or little endian...you know;  Hi Juanxo,I got your reply within about an hour of writing. I couldn't believe I could get a reply so fast, and, more important, a reply that instantly solved my problem. Thanks very much! I was surprised that the fix didn't "unfix" the graphics that used to work, thinking that some graphics were in the right format and some were in the wrong (endianness), but now all my graphics work. Hmm. Thanks heaps. Good luck with your openGL ventures.Cheers,Andrew.