I'm currently messing around with ALLEGRO 5 on an ARM chip (iMX6).
I pretty much seem to have it running but a weird issue has now arisen.
I found this initially whilst using al_convert_mask_to_alpha() converting magic pink to transparency.
The issue is that if I have an ALLEGRO_BITMAP and drawing it straight to the display everything's fine.
However if I write to this BITMAP using al_convert_mask_to_alpha() or even if I draw another smaller BITMAP onto it, then it appears to corrupt the original image.
Setting a single pixel on the image doesn't appear to have any corruption effect..
Any ideas on how I best investigate this to track down the error?
I'm suspicious that maybe it's a colour depth issue (could it change?) but am struggling where to go from here..!
EDIT:
Okay more information.
bmp1 is 200x200
bmp2 is 200x200
bmp3 is 20x20
Load bmp1 and leave as is - drawn okay on display.
Load bmp2 and leave as is - drawn okay on display
Load bmp2 and draw bmp3 on it - bmp3 'part' looks fine, rest of bmp2 is corrupt.
Now..
If I load bmp2, draw bmp3, then draw bmp1 onto it, it looks fine.
If I load bmp2, draw bmp3, then draw bmp1 onto it, then draw bmp3 onto it, it looks fine.
Aarrgh... Bitmap colour depth issue??
EDIT2:
It appears the smaller bitmap is 24 bit depth, the larger images are 32..
Shouldn't this sort itself out..?
Could also be a bug in OpenGL drivers - but more likely in Allegro. Can you post a minimal program reproducing it?
As requested (pardon the hastily stripped down source), also attached the two source images, screenshot showing corruption and allegro.log
tried with 24bit and 32 bit source images - same issue.
Could be OPENGL drivers as I'm using an embedded card using the Vivante GC2000 drivers..
Thanks.
EDIT:
Much more investigation today - I'm now thinking there are driver issues (maybe I need to do something like Trent did for the Raspberry Pi to get Allegro working on this card, but quite frankly that's beyond me).
To summarise, it appears that loading a bitmap and displaying on the screen appears to work, but as soon as I read or write access that bitmap (eg with al_get_pixel()), the image reverts to an 'old' version that's cached somewhere... (in the GPU?) from previously (demonstrated by changing the images used).
Is there any way I can 'invalidate' the bitmap[ stored in the GPU?
Must admit this isn't an area I wanted to investigate and my knowledge of this is pretty much zero.