|
allegro_resizable questions |
shadyvillian
Member #12,426
December 2010
|
is there a way to set the minimum that a screen to be resized? 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. |
jmasterx
Member #11,410
October 2009
|
I want to (try) to implement this as discussed here http://www.allegro.cc/forums/thread/607117/915004#target as 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 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. Agui GUI API -> https://github.com/jmasterx/Agui |
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.) |
AMCerasoli
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.
|
|