What's the format of your 18bpp framebuffer? (hopefully it's not 18bpp packed!).
Mathias
People typically use the same order that the equivalent 32-bit format
would be. So the first byte, red, is the LSB and the last byte, blue, is
the MSB.
> I stand by what I said, android supports RGB, in that order. One byte
> of red, one byte of green, followed by one byte of blue. R,G,B... btw,
> this order happens to be OpenGL's GL_RGB internal format for textures.
Just to make life more complicated, if you look at a GL_RGB pixel in a
word, what you usually see is:
<- MSB LSB ->
00000000bbbbbbbbggggggggrrrrrrrr
...which causes a lot of people to refer to this as BGR. Just to make
life even *more* confusing, the same school of thought will happily
refer to the exact same format as RGB if they're on a big-endian system.
Which is why it's always really useful to follow Mathias' lead and use
the GL_ names. They're at least well-defined!
--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ ⍎'⎕',∊N⍴⊂S←'←⎕←(3=T)⋎M⋏2=T←⊃+/(V⌽"⊂M),(V⊝"M),(V,⌽V)⌽"(V,V←1⎺1)⊝"⊂M)'
│ --- Conway's Game Of Life, in one line of APL
I don't understand what "looking at a GL_RGB pixel in a word" means. A
word has 32 bits, GL_RGB has 24. What you see in the word depends on
how you read that word in the first place. you could have done an
aligned access at the address of where R is (in which case you'd have
the next pixel's R in the top byte and not zeros), or you could have
done an unaligned access at the address just before, or you could have
read all components one byte at a time and merge them back together...
etc...
> ...which causes a lot of people to refer to this as BGR. Just to make
> life even *more* confusing, the same school of thought will happily
> refer to the exact same format as RGB if they're on a big-endian system.
>
> Which is why it's always really useful to follow Mathias' lead and use
> the GL_ names. They're at least well-defined!
Agreed :-)
Also, as I pointed out before, the change that was made to the source
code to "make it work", breaks GL_RGB.
Mathias
Well, I thought it was pretty obvious --- you load your 24 bits, in
natural order, into the bottom end of a quad, exactly the same way that
you'd load a 32 bit value or a 16 bit value or an 8 bit value!
The only thing that makes it the slightest bit complicated is that
GL_RGB is unaligned so you wouldn't be able to use a simple LDR
instruction, but that's just an implementation issue.