I've been using Allegro for a while, but I've encountered a couple of issues that make me question whether or not I'm using it correctly.
The part of my code that handles the drawing looks like this:
Everything works as expected... Or so it seems. If I press Ctrl+Alt+Del, then get out of the menu that appears and then go back to the game, the display is no longer updating, but stuck showing the state of the display before I pressed Ctrl+Alt+Del. This also occurs when Windows' UAC is triggered.
It made me wonder if the event loop stopped for some reason, but nope-- it's still chugging along, and the drawing code is being called, it's just no longer being shown on the display.
If I comment out this line...
... It works fine, and the problem no longer occurs, so it has something to do with changing the target bitmap.
On a related note, I use this code to toggle full-screen:
When I don't change the target bitmap, this code works as expected (the display is now full-screen). However, if I do change the target bitmap, the display just disappears when this is called and no longer responds. It seems like it does go full-screen (because it blocks all mouse-clicks), it's just invisible and I can't do anything with it.
Any idea what I'm doing wrong, or how I can fix this?
PS: I definitely need to be able to be able to change the target bitmap; commenting that line out permanently isn't an option (my coordinate system among other things relies on this).
What platform are you developing on? Mac, windows, Linux?
Thanks for the reply!
I'm using Windows 8.1 with Allegro 5.20. I haven't verified the issue in Linux, because I don't know what the equivalent of the Ctrl+Alt+Del screen/Windows' UAC pop-ups would be...
Also, if it helps, I put together a full example to show the problem:
As you can see, the screen fades in and out from black-to-white. If I press Ctrl+Alt+Del (which shows the menu with Task Manager, Lock, Switch user, etc.; I don't know what to call it, honestly) and then return to the game, the animation stops updating, even though the drawing code is still being called.
If
is commented out, the problem no longer occurs.
Another thing that might be worth mentioning is that I was using 5.0.10 prior to updating to 5.20, and this problem didn't occur.
Thanks for the test example, it was very helpful.
This bug is already fixed on the master branch, and will be in the 5.2.1 release (which is coming soon).
I'm glad to hear that it's already been fixed! I'll keep working around it for now.
Thanks a lot for the quick response.