resizing displays
shadyvillian

How do I make a display that I set ALLEGRO_RESIZABLE to not be able to resize anymore?

Todd Cope

Looks like al_toggle_display_flag() only supports ALLEGRO_FULLSCREEN_WINDOW and ALLEGRO_NOFRAME. The only thing you could do is destroy the display and recreate it with ALLEGRO_RESIZABLE turned off.

SiegeLord

The unstable version has a way to specify size constraints on the window, which you could use to implement something like this.

shadyvillian

I've been using that function in the beginning of the program thats a good idea.

EDIT: doing that messes up the program big time and causes it to crash some how

Luiji99

Do you remember to update all of the pointers to your display?

shadyvillian

What do you mean exactly? I've attached a screenshot to what happens.

Luiji99

No, you haven't.

What I mean is, did you update every single variable of type ALLEGRO_DISPLAY* to point to the new display? If you haven't, at some point you'll try to access the old pointer, which you've destroyed, which will lead to unpredictable results.

shadyvillian

Oh you have to create a new display? I can't do that I'd have to reload all my resources.

Luiji99

That appears to be your only option, sorry. The only resource that I think gets attached to a display is ALLEGRO_BITMAP, though, and I'm pretty sure there's a way to transfer them over from one display to another without reloading them.

Thread #610695. Printed from Allegro.cc