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).