Hello I am trying to read pixels from the target bitmap (al_get_target_bitmap), by locking it.
Unfortunately locking always fails. So I tried cloning the target bitmap and then locking the clone, this also fails
I need to read the target bitmap before saving it to a file, is there any other way I can do this?
SOLVED - SEE POST FOR SOLUTION
Post the code.
Can you lock other bitmaps?
Yes I've just tested and there is no problems with
locking any bitmaps.
On a side note I'm using Allegro 5.0.7 until 5.1 is stable.
Curiously this case works fine in a simple test project, but not in my main, I think it could be a bug in my code somewhere..
Ok I've tracked it down to:
Commenting these lines out makes it go away
Intersting to know. Are you using DirectX? I don't think multi-sampling should prevent reading the backbuffer, in general.
I'm just using vanilla Allegro code on Windows 7 X64,
I assume by default it uses OpenGL.
It seems the code below creates the bug in question.
Allegro uses DirectX by default on Windows.
Is there a way to override this behaviour and make it use opengl?
nvm found it al_set_new_display_flags(ALLEGRO_OPENGL);