|
How to get integers from ALLEGRO_BITMAP |
Chris Katko
Member #1,881
January 2002
|
An ALLEGRO_COLOR struct is four floats. So how do I get integers? I'm pretty sure my screen isn't a floating point 24-bit display... it's not likely to be stored in OpenGL as floats. [edit] To be clear, I mean, without the speed penalty of ALLEGRO converting from NATIVE to FLOAT and back to INTEGER. I just want native. -----sig: |
Edgar Reynaldo
Major Reynaldo
May 2007
|
You only get an ALLEGRO_COLOR when you al_get_pixel. Don't do that. Just access the memory directly and observe the format it was locked in. An ALLEGRO_COLOR struct should only be accessed using the al_unmap_rgb(a)(_f) functions. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Polybios
Member #12,293
October 2010
|
|
|