- Online Community Forums » Programming Questions » allegro_resizable questions

This thread is locked; no one can reply to it. rss feed Print
allegro_resizable questions
Member #12,426
December 2010

is there a way to set the minimum that a screen to be resized?
and is there a way to disable the windows 7 snap feature that makes the window half of the resolution width?

Software Engineer by day, hacker by night.

Matthew Leverton
Supreme Loser
January 1999

No and probably no.

With Allegro 5, you would have to check the resolution and then manually (via al_resize_display()) resize it to the minimum if it is too small.

Member #11,410
October 2009

I want to (try) to implement this as discussed here as
al_set_window_constraints(display, 100,100, 200, 200);

It doesn't seem very difficult, I think the hardest part will just be learning how Allegro works internally enough to do it properly. I'm not sure how to 'add' variables to allegro (for example, windows will need to fetch the constraints each time it gets a WM_GETMINMAXINFO. Should it make a call to
al_get_window_constraints(display, &minX,&minY,&maxX,&maxY); or is there a better way to add variables that each OS could access?

It looks like Allegro calls the os specific function from the vtable for things like getting and setting the window position, but in those cases it looks like the os stores these variables.

Matthew Leverton
Supreme Loser
January 1999

In this case, you would want to update the ALLEGRO_DISPLAY struct with four new variables: min_w, min_h, max_w, max_h. A value of 0 could mean "don't care." The place that receives that message should have a pointer to the proper display.

Another function that would be useful is al_set_display_aspect_ratio(float r), which could be used to maintain 4:3 or 16:10 upon user resizing. (If OS's support such a thing, otherwise one could do it himself after the resize is done.)

Member #11,955
May 2010

No no, A really neat function would be to let the programmer decide, when making the game fullscreen if he wants to keep the aspect ratio of the game or stretch the game to the screen. I think it shouldn't be so difficult, my system is doing it externally, and I think it's a very required function.

Go to: