Allegro 4.2 window size constraints
jmasterx

Hello,
I'm making a game in Allegro that requires the game to be a certain size based on the desktop resolution. I developed a resizing algorithm that ensures the window is never bigger than DESKTOP_WIDTH - 40, DESKTOP_HEIGHT - 40.
It seems however that at certain resolutions, Allegro crashes on initializing the graphics. my algorithm will for instance on 1280 * 800 resolution, -> Allegro Window of 1042 * 613... is there an additional constraint I should be imposing on my window sizing algorithm?

Thanks

gnolam

Try to keep your window sizes as multiples of four. But it shouldn't crash under any circumstances - how are you handling failures of set_gfx_mode()?

Thomas Fjellstrom

I think set_gfx_mode will fail if you try to make a window larger than the screen (including the window border), so always check the return value of set_gfx_mode, and retry with a smaller size.

jmasterx

FIXED IT!!!

They HAVE to be multiples of 2...

Matthew Leverton

It needs to be a multiple of four.

jmasterx

After testing, multiples of 8 fixed everything, thanks all

Trent Gamblin

Just to make sure use multiples of 16.

Tobias Dammers

To make really really extra super sure, use multiples of 0x1000.

Mark Oates

use multiples of PI.

GullRaDriel

You're all wrong. It's just a parameter of the gold number derivative.

type568

You're all wrong. It's just a parameter of the gold number derivative.

Nope, it's all about multiple of current NASDAQ index.

Neil Black

I just make my resolution be 42.

Thread #602508. Printed from Allegro.cc