Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Display Resolution

This thread is locked; no one can reply to it. rss feed Print
Display Resolution
FreeCastle
Member #7,724
September 2006

Hi,

I am a WinXP-User and have a question about the display resolution. Under Windows I use 1024x768, but for my Allegro applications I want to use something like 640x480 or 800x600. So I use the following line:

set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0)

The problem now is that this doesn't work 100% correctly. The Screen-Bitmap (where to draw) I get has a size of 800x600, but it doesn't cover the whole screen. There is always a black area on the left side of the screen. I hope you understand what I mean... so maybe anyone knows this problem or has an solution for it ?
Thanks...

Krzysztof Kluczek
Member #4,191
January 2004
avatar

Quote:

The problem now is that this doesn't work 100% correctly. The Screen-Bitmap (where to draw) I get has a size of 800x600, but it doesn't cover the whole screen. There is always a black area on the left side of the screen. I hope you understand what I mean... so maybe anyone knows this problem or has an solution for it ?

You are using CRT monitor, right? :) If yes, then probably you just have to play a bit with monitor image positioning settings. Monitors usually remember only limited number of recently used display modes (various refresh rates counts as display modes, too), so if you didn't use 800x600 recently positioning could have got reset to defaults. :)

FreeCastle
Member #7,724
September 2006

Yes I use a CRT monitor.
That means, I have to adjust the hardware settings of my monitor ? Sorry I am not a great English speaker, but I hope you understand. (If not: I mean the buttons on my monitor, which I can change with my hands)

But ist there no (Allegro)software solution for that problem ? I mean, if I e.g. start simple games coded with DirectDraw I don't have this problem...

Tobias Dammers
Member #2,604
August 2002
avatar

If a DirectDraw program has the problem and yours doesn't, and they both use the exact same video mode, then the problem must be in your code. Allegro uses DirectX in Windows.
Have you checked the same program in a windowed graphics mode?

Apart from that, you cannot set the crt settings from within allegro. Some video cards allow you to make some adjustments, but it mostly comes down to the monitor. Even windows can't access a crt monitor's adjustment data.

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

FreeCastle
Member #7,724
September 2006

Well, I have to admit, that I have no sample DDraw programm of myself. But take e.g. the game StarCraft. It runs in 640x480 (or 800x600, I don't know exactly) and it is written with DDraw. There I don't have this problem...

Evert
Member #794
November 2000
avatar

Quote:

it is written with DDraw

Allegro uses DirectDraw.

Anyway, long story, but your monitor may need to be adjusted (it's what these buttons on the front are for) if it's running in a different display mode or witha different refresh rate. It's not a software problem.

LordHolNapul
Member #3,619
June 2003
avatar

I've this problem too in my game... I use Windows ME and I've a 32 bit colour game:
My starting Windows resolution is 1024x768 and I've a 17'' monitor flat in front but CRT (is it right ? CRT means that the monitor have a back long)

1024x768 ok
800x600 ok
640x480 black area upper and right
320x240 ehy, this didn't work now... boh.

This is a problem I didn't consider too much. But Remember to test the return code of the Install functions, to prevent and notify errors during the setup of your games..

ciao

BAF
Member #2,981
December 2002
avatar

Did you adjust the settings? You probably just have to set the correct positioning, etc on your monitor. And yes, CRTs are the big ones.

FreeCastle
Member #7,724
September 2006

Till now I didn't change anything. But I tried to switch my windows resolution to 800x600 and then tried to start my Allegro app and it was the same result :(
I'll try it later with adjusting... BUT even if this solves that problem I don't think that this is a satisfying solution. I mean, every time I want to start an Allegro app I have to adjust the monitor settings on my monitor and then when I get back to windows I have to adjust the monitor settings again, so that I have a correct display on windows.....

Don Freeman
Member #5,110
October 2004
avatar

Bump so you can add something FreeCastle... :)

Edit:
I don't think it is a resolution problem as much as a frequency problem... There should be some sort of frequency control in your GFX driver. You should be able to manually set this to some locked freqency and you wont have to adjust your monitor after each use of 'such-and-such' program...

--
"Everyone tells me I should forget about you, you don’t deserve me. They’re right, you don’t deserve me, but I deserve you."
"It’s so simple to be wise. Just think of something stupid to say and then don’t say it."

Richard Phipps
Member #1,632
November 2001
avatar

Do the allegro examples (especially the ones where you can choose different screen sizes and colour depths), have the same problem?

FreeCastle
Member #7,724
September 2006

Ahhh, okay now I got it ;)
Thanke you all very much for your help

Go to: