Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Allegro 4.4 windowed limitation?

This thread is locked; no one can reply to it. rss feed Print
Allegro 4.4 windowed limitation?
Zepper
Member #8,715
June 2007
avatar

When I tried to setup a 1365x980 (4x using 4:3 aspect) in windowed mode, Allegro gave me an error.
All the others work fine (2x and 3x).

#SelectExpand
1Error: 2Unable to find a suitable graphics driver 3(WINDOWED, 1365 x 960)

Suggestions?

EDIT: running gfxinfo, any windowed mode is supported.

#SelectExpand
1C:\Program Files\Dev-Cpp\allegro\build\tests>gfxinfo DXWN 2Allegro graphics info utility 4.4.2, MinGW32 3By Lorenzo Petrone, 2011 4 5Name: DirectDraw window; driver ID: DXWN 6This is a windowed mode driver. You can use any resolution you want. 7 8 9C:\Program Files\Dev-Cpp\allegro\build\tests>gfxinfo DXOV 10Allegro graphics info utility 4.4.2, MinGW32 11By Lorenzo Petrone, 2011 12 13Name: DirectDraw overlay; driver ID: DXOV 14This is a windowed mode driver. You can use any resolution you want.

GullRaDriel
Member #3,861
September 2003
avatar

Isn't that coming from OpenGL being the default driver from 4.X ? (I may be wrong)
How do you set gfx mode ? I mean, which parameters do you pass to set_gfx_mode ?

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Zepper
Member #8,715
June 2007
avatar

Using GFX_DIRECTX_WIN gives an error of overlays not supported.
Using GFX_AUTODETECT_WINDOWED gives an error of unavailable gfx driver.

Nothing special about calling set_gfx_mode()...

err_code = set_gfx_mode(GFX_DIRECTX_WIN,1365,980,0,0);

EDIT: It seems the number must be a multiple of 4.

256x240 (original) -> x4 = 1024x980 -> x4:3 -> 1365,33x1280

It worked with 1364 and 1368 but not with 1365, 66 or 67.

Chris Katko
Member #1,881
January 2002
avatar

Is the window bigger than your display?

Zepper said:

GFX_AUTODETECT_WINDOWED gives an error of unavailable gfx driver.

That... that sounds like a more fundamental error is going on.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

GullRaDriel
Member #3,861
September 2003
avatar

If I understand the OP correctly, the problem comes from the same program working with allegro2&3 and not 4.X, with the same running specs.

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

LennyLen
Member #5,313
December 2004
avatar

If I understand the OP correctly, the problem comes from the same program working with allegro2&3 and not 4.X, with the same running specs.

Actually, I think his references to 2x, 3x and 4x were to do with multiples of his original image which was 256x240.

I don't know why he wants 1365x980 as it's NOT a 4:3 resolution (240 x 4 is also 960 not 980).

Chris Katko
Member #1,881
January 2002
avatar

Yeah, even if you were emulating something, pick a normal resolution, and then throw some black bars.

Unless you're time travelling and using a CRT, there is NO ADVANTAGE to using a wrong resolution because it's just going to be (horribly!) distorted as it's shoved back into the native resolution in fullscreen mode. And in windowed mode? Again? What's the advantage? It's a window.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Zepper
Member #8,715
June 2007
avatar

1. It's a NES emulator for Windows. It uses Allegro 4.4 for inputs, video and audio.
2. The NES NTSC image is 256x240 pixels. I'm upscaling the image by 2x, 3x, 4x and 4.5x.
3. If you read my 1st message, you'll read "960" instead of my typo "980".
4. Fact: Allegro does not support any windowed mode that's not x4 in length.

Thank you. It's ok.

LennyLen
Member #5,313
December 2004
avatar

Zepper said:

3. If you read my 1st message, you'll read "960" instead of my typo "980".

I did see that, but than you later refereed to 1365,33x1280. I got a bit confused at that point as to what resolution you were actually going for. ;)

How did you work around the multiple of 4 issue in the end?

The multiple of 4 but should be mentioned in the documentation. You're not the first person to have raised the issue.

Zepper
Member #8,715
June 2007
avatar

I'm using a length of 1316 pixels, upscaling the bitmap.
No problems.

Go to: