Re: [AD] al_acknowledge_display_disconnected

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Tue, 22 May 2012 00:28:17 -0600, Trent Gamblin <trent@xxxxxxxxxx> wrote:
> Is this a horrible idea? We need this function, but there's a catch. I first implemented it as a plain void function for testing with some global booleans. It worked, then I went to do it properly. Put a vtable entry in (acknowledge_display_disconnected(ALLEGRO_DISPLAY *)) and the main library function as the subject says, also taking an ALLEGRO_DISPLAY.
> 
> The problem is, the display has to be destroyed. And it has to be destroyed before the work is done in al_acknowledge_display_disconnected. But you can't destroy the display in user code, and then call vtable entries in that display. So what I did was make said function destroy the display itself. There may be better options though. It seems a little bit wrong for it to destroy the display, even if it's well documented. Not sure why I feel that way. But it works well, so I don't know. Any better ideas?
> 

What does al_acknowledge_display_disconnected do?

Can you put the ALLEGRO_DISPLAY into an no-op state and send an event?
Then the user can call al_destroy_display on it as usual, or continue
obliviously (probably uselessly).

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/