Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / strange problems with display settings

Author
Message
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Jun 2011 12:41
A while ago I noticed that the values returned by desktop width() didn't match the display settings in Control Panel. For width and height DBPro returned 1344x840 while Control Panel showed 1680x1050.

I then made some changes to the display settings (I was experimenting with anti-aliasing at the time) and noticed that at some point the desktop values reported by DBPro became the same as those showing in Control Panel.

That remained the case until today when I updated my nVidia display driver. I'm now back to the 1344x840 vs 1680x1050 issue and don't know which particulr change brought the two things into line.

Am I right in thinking that the desktop values should be those reported in Display Settings in Control Panel?

Can anyone cast light on this issue?

Here's the code I used to check:



That code currently reports 1344x840 which doesn't even seem to be a supported screen setting. Where does it come from? (And how can I get the desired 1680x1050 setting back?)
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Jun 2011 12:58
Have you used IanM's DISPLAY WIDTH() and DISPLAY HEIGHT()? He must have created them for a reason

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Jun 2011 13:09
They return the same values, i.e. 1344x840.

I don't think this is a DBPro vs Matrix1 issue. I suspect it's something to do with Windows and the graphics card. When it happened before it was after a graphics card upgrade.

By the way, what's the difference between fulldesktop and fullscreen? I've just noticed that when I change the DBPro project screen type property from fulldesktop to fullscreen I get the 1680x1050 that I expect.

Where do these values of 1344x840 come from? And how can I change them? I know it's possible because I've done it before (without changing to fullscreen).
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Jun 2011 14:04
I've noticed similar/same issues on my laptop - I think it affects resolutions that are not 'standard'. On my desktop PC the display is 1680x1050, and that works fine, but my laptop is 1366x768, and that does some really strange stuff.

It might be best to do the old 'checklist for display modes' method, find the biggest supported resolution and use that.

I think it's just a legacy thing - when DBPro was conceived, display resolutions were much more of a standard, nowadays there's really no such thing as standard screen resolutions. It can be a real pain to get true resolution independance.

The fullscreen desktop mode is like the windowed modes - allowing application switching without the same issues. Fullscreen exclusive will take full control over the PC, leaving little or nothing for other processes. I think that's why it can deal with resolutions a bit better.

Health, Ammo, and bacon and eggs!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 9th Jun 2011 14:25
Fullscreen desktop will scale a DBP window to the current desktop size, whilst fullscreen exclusive will reset your desktop resolution to whatever the DBP app uses.

My signature is NOT a moderator plaything! Stop changing it!
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Jun 2011 14:54
Quote: "Fullscreen desktop will scale a DBP window to the current desktop size, whilst fullscreen exclusive will reset your desktop resolution to whatever the DBP app uses."


But what is "current desktop size"? Where is it specified? How do I change it?

Windows Control Panel says I'm using 1680x1050 display mode but DBPro says the desktop is 1344x840 - and I can't find anything else that refers to such a display mode.

The annoying thing is that I know it CAN be changed since I've done it before - but can't now recall what I did exactly (and blind experimenting by making the various changes I know I made before have acheived nothing). I know I didn't change the project property to fullscreen.
Booma
17
Years of Service
User Offline
Joined: 29th Mar 2009
Location:
Posted: 9th Jun 2011 20:38
Green Gandalf I can't reproduce your error, but DBPro function DESKTOP WIDTH simple enough:



so I don't think that there are an error. I am modify this function try to test it:



this command from attachment.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Jun 2011 23:29
Booma

Thanks for trying to help but both versions of your code give the same strange values: 1344x840.

Does anyone know where these come from or how they can be changed?

I've just upgraded the GFX card to the most recent version from nVidia and I get the same problem (the earlier driver update was an older update received today via Windows Update!).

I wish I could recall what I did to get the full 1680x1050 after the last upgrade a few months ago.

Does anyone with an nVidia GeForce GTX 285 card have similar problems??
RedFlames
18
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 10th Jun 2011 00:08
What version of Windows are you using? Sorry if you said it somewhere, i'm unable to concentrate on anything right now...

I did a quick search at google, and smewhere it says that getSystemMetrics() returns a different value if you set the "desktop DPI settings" to something other than 100%. So if you set it to 125% in the control panel you'll need to multiply the results by this factor (i guess). E.g. 1344 * 1.25 = 1680 and 840 * 1.25 = 1050

Maybe this helps, now we'd just need a way to read that value in DBP

I'll try to reproduce that behaviour now... or maybe I'll just go to bed

Oh and also, thinking about it... somehow i doubt that setting was changed if you just updated the driver? Maybe it's not that easy, but you could look into this anyway.

Hope this post will make some sense, I'm tired
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Jun 2011 00:25 Edited at: 10th Jun 2011 00:41
Quote: "What version of Windows are you using?"


The problems are on Vista 64 bit. I get the usual consistent results on XP 32 bit.

Quote: "Oh and also, thinking about it... somehow i doubt that setting was changed if you just updated the driver? Maybe it's not that easy, but you could look into this anyway."


Interestingly, I've just tested a commercial game (HOMM4) after the two latest GFX card driver upgrades today and the game area no longer fills the screen. So something has been changed behind my back.

Quote: "I did a quick search at google, and smewhere it says that getSystemMetrics() returns a different value if you set the "desktop DPI settings" to something other than 100%. So if you set it to 125% in the control panel you'll need to multiply the results by this factor (i guess). E.g. 1344 * 1.25 = 1680 and 840 * 1.25 = 1050"


I'll look into that as well. Thanks for the suggestion.

Edit

I can't find a setting for "desktop DPI settings". Where is it?

I did, however, find something called "scaling mode" in the nVidia control panel. I changed that and now the HOMM4 game window fills the screen correctly.

Had no effect on the 1344x840 issue though.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Jun 2011 01:19 Edited at: 10th Jun 2011 01:20
RedFlames

Thanks. Your suggestion fixed the issue.

I've now found the DPI settings thing - it was in the left hand pane and I was only looking at the various things in the right hand pane.

Apparently I needed to choose the options shown below:



I'm still a bit puzzled though - I've never knowingly used that setting before and I'm sure I found another way to cure the problem. Anyway, I now have a nice clear desktop again - and DBPro reports the same values as Control Panel.

Thanks again.
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 10th Jun 2011 01:25
I don't have this problem on my both computers
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 10th Jun 2011 02:18
I'm at 1680x1050 using Visa 64 bit and get exactly what it should be but I use a GeForce G100.

Non Sequitur M
17
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 10th Jun 2011 05:53
What the heck!? I'm in the minority here with 1280x800!!!

Anyway, about this statement:
Quote: "But what is "current desktop size"?"

The desktop, seems to me, is set at a specific size. I think that desktop width() and desktop height() are used to find a computer's native resolution. I just made a game for the last coding challenge, and no matter what I set screen resolution to, those commands always read back as 1280 and 800 respectively. I tried both DBP commands and setting it manually. I think the desktop is set by, a) your monitor, or more probably b) your graphics card. But, someone can correct me if I'm wrong.

Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 10th Jun 2011 07:04
@ Amo Deus Man:

DESKTOP WIDTH() and DESKTOP HEIGHT() is the size of your desktop in Windows. SCREEN WIDTH() and SCREEN HEIGHT() is whatever resolution the Darkbasic Pro window is set at (regardless of what resolution Windows is at).

If you changed the resolution in your Windows Display Settings you'd see different numbers instead of 1280x800 consistently. Using SET DISPLAY MODE only changes the Darkbasic Pro window resolution.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Jun 2011 12:25 Edited at: 10th Jun 2011 12:26
Quote: "DESKTOP WIDTH() and DESKTOP HEIGHT() is the size of your desktop in Windows"


Quote: "I think that desktop width() and desktop height() are used to find a computer's native resolution."


Is it as simple as that? I get different values depending on the IDE screen properties I've chosen. Or do some of those properties change the Windows settings? However there is more to it than that as RedFlames pointed out.

What exactly is "the desktop"? Why does it differ from the display setting shown in Control Panel in some cases (as I indicated a few posts back).

On my PC the native resolution is 1680x1050 which is what I set in Control Panel.

And why do I have to choose the "Use Windows XP Style DPI Scaling" option to actually get the native resolution? Seems confusing.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 10th Jun 2011 17:37
Quote: "Is it as simple as that? I get different values depending on the IDE screen properties I've chosen. Or do some of those properties change the Windows settings? However there is more to it than that as RedFlames pointed out."


The project settings in IDEs shouldn't be able to change the windows settings... it should only change the resolution of the Darkbasic Pro window.

I hate to say it but maybe your video card is messed up. Just to test it I changed my DPI scale to 125% and ran your first code snip and it worked exactly as it should (see attached image that saved as 1680x1050 despite the DPI scale). I also tried every resolution and it always returned the exact resolution I was using each time.

Quote: "What exactly is "the desktop"? Why does it differ from the display setting shown in Control Panel in some cases (as I indicated a few posts back)."


If your computer is a laptop too (like Van B) it may be the nature of the beast. I've worked with several laptops and they always seem to have weird resolutions I've never seen on any Desktop PC.

Quote: "And why do I have to choose the "Use Windows XP Style DPI Scaling" option to actually get the native resolution? Seems confusing."


That's probably one of the indicators that the video card is flawed somehow... it should fill your screen at 100% scale too. My monitor auto-adjusts the screen when the resolution changes (yours may too) but that shouldn't effect the numbers Darkbasic Pro returns.

Non Sequitur M
17
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 10th Jun 2011 19:40
Love the desktop, Grog! What is it?

Anyway, on topic: Ok. Let me get this straight... Wait a second, I can't get this straight! Well then... What's the difference between the two sets of WxH commands!? I left my desktop at it's native size, and set my fullscreen program to 1024x768, and the desktop commands read 1024x768. <<<That's not my native at all! I don't get it.

Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 10th Jun 2011 21:44 Edited at: 10th Jun 2011 21:45
Quote: "Love the desktop, Grog! What is it?"


I'm not sure where it's from but it's called "Century City". I attached the actual image for you.

Quote: "What's the difference between the two sets of WxH commands!? I left my desktop at it's native size, and set my fullscreen program to 1024x768, and the desktop commands read 1024x768. <<<That's not my native at all! I don't get it."


I don't know. Maybe your video cards are fine and it's just Windows being weird. There's no way to tell for sure since it works for most of us flawlessly. Have you guys tried what BatVink suggested and try IanMs commands?



Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Jun 2011 22:07
Quote: "Have you guys tried what BatVink suggested and try IanMs commands?"


Yes. See my reply to BatVink . IanM's display width() command returns exactly the same as the desktop width() command in all my tests on both machines.

Actually, Grog, your screenshot shows exactly the settings I'm now using and which seem to work (as suggested by RedFlames).

It also makes my desktop look very lame .

I've had this sort of issue twice now - both after upgrading the GFX card driver. Perhaps I'm doing it wrong ...

Quote: "That's probably one of the indicators that the video card is flawed somehow"


That is possible since a few other odd things happen from time to time. But not since I followed RedFlames advice interestingly (unless you count unexpected hanging while editing code in the DBPro IDE ...).
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 11th Jun 2011 00:25 Edited at: 11th Jun 2011 00:26
Quote: "It also makes my desktop look very lame."


Yeah... mine was giving me a headache while it was in 125%.

Quote: "That is possible since a few other odd things happen from time to time. But not since I followed RedFlames advice interestingly (unless you count unexpected hanging while editing code in the DBPro IDE ...)."


Little glitches happen every once in a while for me too but some are consistent. Like when I run the above code snip I see only the top line of the = sign when it prints "IanMs Display Width = "... and it does that every time.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Jun 2011 00:33 Edited at: 11th Jun 2011 00:33
Quote: "Like when I run the above code snip I see only the top line of the = sign when it prints "IanMs Display Width = "... and it does that every time."


No such problems here.

Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 11th Jun 2011 01:42 Edited at: 11th Jun 2011 01:46
Zooming in I can see why it's doing it. It's shrinking the line a bit... weird.



Edit: Hey, you're getting the right numbers now!

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Jun 2011 12:03 Edited at: 11th Jun 2011 12:05
Quote: "Hey, you're getting the right numbers now!"


Indeed I am. That's what I've been trying to tell you all for quite a few posts now:

Quote: "RedFlames

Thanks. Your suggestion fixed the issue.
"


Anyway, turning to your problem, it sounds like your native resolution is not 1680x1050 (or something like that) so that some pixels get lost in the filtering (or perhaps some lines of pixels get skipped when there's a mismatch - I'm never quite sure about such details ). I'll see if I can reproduce the symptoms by fiddling with the settings here.

No wonder we never get anything constructive done at times .

On a completely different subject why did the attached Window suddenly pop up while I was typing this?



Could it be something to do with the fact that I've just upgraded to IE9 - or is it to do with the fact that one of our cats is sprawled across the keyboard as I'm trying to type?

I've also noticed that since IE9 the browser will suddenly take me out of a thread when I'm typing a message quickly. Very annoying - and the cat wasn't involved then.
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 11th Jun 2011 12:12
Quote: "I don't have this problem on my both computers "

so... do you have it on one of them?



[leaves thread]


Why does blue text appear every time you are near?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Jun 2011 12:44
Grog Grueslayer

Just done some experimenting. I changed the display to 1600x1200 so there was a slight mismatch with the native resolution. Then I ran this code.



If you press "v" then the text is printed one line lower. Press "v" a few times and will see that some lines of pixels fade or become brighter. I couldn't find a combination that made a line of pixels completely disappear but I guess something like this is your problem. You may need to experiment with the font sizes to reproduce the symptoms.
Non Sequitur M
17
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 11th Jun 2011 18:41
Well, if you're not in your native resolution, that's why things get blurry and stuff. If you move text down 1 line, but you're not native, then in actuality, you moved it down 1 1/4 times(just as an example). That causes weird blurry effects, just the same as if you try to load or capture an image that is not a width and height equal to a raised power of 8.

If the universe isn't a program, then why do planets orbit in loops, death sparks life, and human interaction is buggy and glitched?
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 11th Jun 2011 19:55 Edited at: 11th Jun 2011 20:10
Yeah it definitely has distortion at 1680x1050. I wonder what my resolution should be at if it's distorted at the max.

Edit: I started doing experiments but I keep getting interrupted by humans so I'll experiment later.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Jun 2011 22:42 Edited at: 11th Jun 2011 22:43
Quote: "I wonder what my resolution should be at if it's distorted at the max."


Your GFX card usually has software installed with it which enables you to find out what the native screen resolution is (and change anti-aliasing settings etc).

On mine it is the nVidia Control Panel which appears in the Windows Control Panel and the relevant page is

Login to post a reply

Server time is: 2026-07-11 00:36:11
Your offset time is: 2026-07-11 00:36:11