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
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()?
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.
FIXED IT!!!
They HAVE to be multiples of 2...
It needs to be a multiple of four.
After testing, multiples of 8 fixed everything, thanks all
Just to make sure use multiples of 16.
To make really really extra super sure, use multiples of 0x1000.
use multiples of PI.
You're all wrong. It's just a parameter of the gold number derivative.
You're all wrong. It's just a parameter of the gold number derivative.
Nope, it's all about multiple of current NASDAQ index.
I just make my resolution be 42.