Hi, I have a question about the channels in a SDL_Buffer and then a question about SDL in general.
My question about SDL_Buffer channels is – why isn't there any standard order in which the different channels lie inside of the buffer? My system doesn't use big endian (I guess it uses little endian), so according to an example here the masks for r, g, b and alpha should be
In other words, the channels would be in the order a, b, g, r if you take the least significant byte last. However, the screen buffer that is created by sdl with SDL_SetVideoMode will get channels in the order r, g, b, where b is in the LSB, and no alpha channel. Here the order is reversed. Why? According to the example, it seems like the order of the channels is important, but apparently it doesn't match with that of the screen buffer. I'm starting to doubt that it matters at all.Code:rmask = 0x000000ff; gmask = 0x0000ff00; bmask = 0x00ff0000; amask = 0xff000000;
Also, when I create an optimized (for blitting to the screen buffer) buffer using SDL_DisplayFormatAlpha, or if I render a text (using the SDL_ttf library) with TTF_RenderText_Blended, the channels will be in the order a, r, g, b. Here the channels are in the same order as in the screen buffer, only an alpha channel has been added in the MSB. However, if I load an image from a file (using the SDL_img library) with IMG_Load, the channels will be in the order b, g, r (the image files doesn't have alpha channels). Now the order of r, g and b has once again been reverted, matching the order of the example I linked to before.
So, my question again - why isn't there any standard order in which the different channels lie inside of the buffer (at least a unifying standard for the specific endianness), why does it differ so much?
And then a question about SDL. It doesn't seem to be very much information about it. Although the official documentation covers every part briefly, there doesn't seem to be any deep going documentation about it. How comes? It is a pretty well used library after all, isn't it? The only wiki I have found about it doesn't seem to be very large, and I have only found one small forum about it.