Re: [AD] X mode restoring.

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


On Mon, Jan 3, 2011 at 11:17 AM, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> wrote:

>
> Basically, if the al_create_display succeeds, I destroy the previous
> fullscreen display (and it must not mess up the fullscreen display just
> created). If it failed, I keep the previous fullscreen display.

I would suggest not doing that imo ;) so full of wrong. just keep the same
display object. if the mode change isn't working, lets get it fixed, rather
than making bodges like that, that we have to support.


So what should happen when you call al_create_display while a fullscreen display does still exist (on the same adapter)?
 
> I guess for multi-monitor, the check has to be updated to not restore the
> mode if there's another fullscreen *on the same monitor*. I guess it's just
> another if-clause which checks the monitor the display is on. (No idea
> which field in ALLEGRO_DISPLAY does tell that though.)

My new changes make it so display->adapter stores the allegro virtual adapter
id. So I suppose that'd work, just compare the adapters, and ignore the mode
restore if theres another display already open, but as I said above, this
really shouldn't be an issue.


Well, the previous behavior of restoring the desktop mode while a fullscreen display exists on the same adapter sounds wrong to me as well. We could say in the documentation that al_create_display will never try to create a fullscreen display on an adapter where another fullscreen display already exists though. It would be important to explain that in the docs though then, since as Matthew said, the expectation could be quite different.

The behavior I assumed is used by ex_display_options right now, and after that check in al_destroy_display it seems to work for me (only tried under Ubuntu 10.10. though). If we disallow it, that example would have to first destroy the old display, then create the new one, and if it failed try re-creating the old one (and if that also fails, weep). So much more complicated than just creating a new display and destroying the old one if it succeeds otherwise keeping the old one. Think of a mode selection dialog in a game settings menu, something like this would be common there.



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