On the reference page for SurfaceFormat, it indicates that the Bgra4444 format is an unsigned format which is 16-bits long, with 4 bits per color with alpha. Further down the page, it describes the Rgba64 format as being 64-bits long, with 16 bits per color (including alpha).

Why does one format list R-G-B as the color order, while the other lists it as B-G-R? I understand it likely has to do with the underlying hardware, but there certainly needs to be a reason that it wants it in a reversed order for the other format.

  • 3
    why is there big and little endian? kinda the same issue – ratchet freak Dec 17 '14 at 20:33
up vote 4 down vote accepted

"Just because."

Byte ordering is more-or-less arbitrary. Some hardware will do it one way, other hardware will do it another way... there's basically an equally valid argument in both directions so you just pick one.

There's no particularly relevant technical reason why some formats are in RGB order and others in BGR. It likely comes down to when the format support was needed, it was asked for in that order (because that was the client preference, or because somebody was mimicking or emulating older hardware that did it that way).

  • Big-Endian or Little-Endian. One might as well argue over which end one should crack a boiled egg at. – Pieter Geerkens Dec 18 '14 at 3:33

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.