[AD] RGBA_5551 bug

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I'm not sure if this is a driver bug, or a bug in Allegro, but the
program listed below prints out 0 for the alpha value for me on Linux. I
first saw the problem in the game Thomas and I are working on, but from
what I gather, he didn't have this problem. I don't have this problem on
Windows or OS X on the same machine either. I just upgraded from Ubuntu
10.04 to 10.10 and it made no difference. The al_get_pixel code (the
macros for put and get actually) look ok to me but I could be wrong. So
not sure how to file this one. Anybody else get 0 printed for the alpha
value?

Trent

-----

#include <allegro5/allegro.h>
#include <allegro5/allegro_primitives.h>
#include <stdio.h>

int main(void)
{
        al_init();
        al_init_primitives_addon();
        al_create_display(800, 600);
        al_set_new_bitmap_format(ALLEGRO_PIXEL_FORMAT_RGBA_5551);
        ALLEGRO_BITMAP *b = al_create_bitmap(100, 100);
        al_set_target_bitmap(b);
        al_clear_to_color(al_map_rgb(0, 0, 0));
        al_draw_filled_rectangle(0, 0, 100, 100, al_map_rgb(100, 125,
150));
        ALLEGRO_COLOR pixel = al_get_pixel(b, 50, 50);
        printf("%f %f %f %f\n", pixel.r, pixel.g, pixel.b, pixel.a);
        return 0;
}






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/