1

I am using C++ with Allegro 4.2 to build a windows game.

I want stretchable graphics in windowed mode.

I'm am one who likes giving users of my programs lots of options; I always hate when I'm playing a game in windowed mode and I'm either not allowed to stretch the window or the content inside the window doesn't stretch with it (this sucks a lot for 640x480 size games played on high resolution screens that don't even allow for fullscreen; requiring a magnify tool to play it properly). I'm wondering if there is some way in Allegro or perhaps if there is another programming library that allows the graphics to stretch with the shape of the window itself. I already know how to have my Allegro applications switch to fullscreen mode; I'm trying to improve the windowed mode.

A big reason for this is because my artstyle is low-resolution art (I call it "Bitmap Brothers" style); it's very good for games since it's organized and easy to edit. I don't want to have to go higher than 640x480 to increase the size because it's far to high for low-resolution art, but my window remains too small during windowed mode.

I noticed that Allegro 5.0.8 has this line of code: al_set_new_display_flags(ALLEGRO_WINDOWED | ALLEGRO_RESIZABLE);

At the end it says "ALLEGRO_RESIZABLE", could that be the feature I'm looking for? If so, just how much does Allegro change from 4.2 to 5+?

1 Answers1

0

Allegro 4 doesn't support user-resizable windows.

Allegro 5 does (as you've noted), but it is completely rewritten and is not backward compatible at all. Still, I would highly recommend that you switch to it as development on Allegro 4 is all but dead.

Matthew
  • 47,584
  • 11
  • 86
  • 98
  • I assume the re-sizable window stretches the graphics as well? – Keith Wiggins Apr 18 '13 at 14:58
  • With Allegro 5, you are notified via an event when the display is resized. If you don't acknowledge the resize, I believe the graphics remain stretched, although it's probably not documented behavior. If you don't want to rely on that behavior, it's trivial to set up a global transformation that scales or "crops" all of your drawing operations to the desired size. – Matthew Apr 18 '13 at 15:56
  • Alright I'll try upgrading to Allegro 5 then and see how it turns out. Are there any other libraries or programming methods that you know of that might clue me further into having this feature? – Keith Wiggins Apr 19 '13 at 03:45