16 bit textures

Blitz3D Forums/Blitz3D Programming/16 bit textures

Shifty Geezer(Posted 2005) [#1]
I just tried my program at 16 bit and the textures for my controls, which I use functionsot write to the alpha channal, were squeezed into the right half of the texture and reasonably corrupted.

Any ideas on what this is and how to stop it?


big10p(Posted 2005) [#2]
When you load textures in a certain graphics mode (16-bit, 32-bit etc.), they're automatically converted to the same bit depth, regardless of the bit depth of the image file.

So, your code that writes to the alpha channel needs to take this into account since the bits used for RGBA will be different for all the graphics modes that use a different bit depth.


Neochrome(Posted 2005) [#3]
ARGB

r=(RGB1 And $FF0000) Shr 16 ;separate out the red
g=(RGB1 And $FF00) Shr 8 ;green
b=(RGB1 And $FF) ;and blue parts of the color
a=(RGB1 And $FF000000) Shr 24 ; extract the alpha

this could be usefull