Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Display lost/found state events never fired

This thread is locked; no one can reply to it. rss feed Print
Display lost/found state events never fired
simast
Member #12,668
March 2011

Hi allegros,

I am looking forward to using the real fullscreen mode (ALLEGRO_FULLSCREEN and not ALLEGRO_FULLSCREEN_WINDOW). However, the way I understand Allegro will try to preserve bitmap textures under DirectX automatically. And this basically happens all the time when you toggle fullscreen/windowed mode under ALLEGRO_FULLSCREEN flag (you have to re-create your display). So essentially after switching to fullscreen mode you end up blitting from system memory to your video backbuffer (and that's slow).

I found a simple fix is to re-create all your bitmaps after fullscreen switch so they get placed in video memory again. But there is that unnecessary overhead from Allegro side (with that texture-preserve behaviour). So to remove it I found about ALLEGRO_NO_PRESERVE_TEXTURE bitmap flag and it seems to work great, display is lost from time to time and bitmap content is messed up - exactly what I expect.

The thing is that to restore bitmaps the docs state I should listed for the following events:

ALLEGRO_EVENT_DISPLAY_FOUND
ALLEGRO_EVENT_DISPLAY_LOST

... and the problem is that they never appear on my event queue (display is obviously registered with it).

Is this a know Allegro bug? I am missing something in display creation code that would trigger these event from firing?

Edit: Using Allegro 5.0.1

Go to: