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 / How to determine user's screen resolution?

Author
Message
Steverino
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 13th Jan 2003 18:35
How do you find out what resolution the user's system is actually set to?

PERFORM CHECKLIST FOR DISPLAY MODES tells me their graphics card can handle 1920x1080 (but doesn't mention that their monitor's only good up to 1024x768). If they're running Windows at 800x600x32, I'd like to make my DB program run at that too. If there's a single DBP command for this, I can't find it in the docs. Any ideas?
Surrealist writing toy -- http://www.iconpoet.com
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 13th Jan 2003 18:54
Well, there's my DLL - which lets the user select a valid graphics mode (no 8 or 24 bit modes) - If I remember correctly the default selection is the current resolution (if not, it can easily be updated).

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
mimesis
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Norway
Posted: 13th Jan 2003 21:44
Probably there is a function call you can use to one
of the windows dll's, like "user32.dll" or "gdi32.dll".
Can any dll guru confirm this?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Jan 2003 22:17
Use this to get the current desktop resolution:



One thing - if you set the app to fullscreen non-windowed mode, then it will report that resolution, not the desktop resolution.
mimesis
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Norway
Posted: 13th Jan 2003 22:23
IanM,U r the MaN!
ThX a lot!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Jan 2003 22:49
You're welcome.

I think I might keep track of all these little snippits on my web site ... if I ever get around to finishing it
mimesis
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Norway
Posted: 13th Jan 2003 23:52
Is it possible to detect the Screen Depth also with
the same function call?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Jan 2003 00:36
There'ss no easy way to do it from windows... try using 'screen depth()' instead
mimesis
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Norway
Posted: 14th Jan 2003 01:54
No! I refuse to use a dbp command. Must use DLL!
They are : a)better b)faster c)great forum support!

It's only a matter of time until we can replace the
whole dbp language with dll calls!

he!You didn't see that one coming ,didn't you dbs?

!power to the people!
Mnemonix
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 14th Jan 2003 03:41
Can i post your code snippit in my forum? IanM

If you forget one little thing i shall have you shaved sterilised and destroyed: Jeffrey Goines
Steverino
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 14th Jan 2003 03:55
Thank you, IanM! What a truly excellent snippet.

Surrealist writing toy -- http://www.iconpoet.com
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 14th Jan 2003 04:20
all hail that snippet for it is divine thankyou also

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Jan 2003 14:30
Everyone anywhere is hereby granted the right to use any code I publish for any use whatsoever with no restrictions.

Was that wide ranging enough?
Help yourselves guys.
Mnemonix
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 14th Jan 2003 19:32
TY

If you forget one little thing i shall have you shaved sterilised and destroyed: Jeffrey Goines
Kangaroo2
22
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 14th Jan 2003 20:10
Steverino and especially IanM THANK YOU I was just about to post a thread asking how to do that exact thing! Most most useful, IanM you just earned yourself a thank you in my credits of my games If you want your full name or a weblink, just email me

A_M
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 14th Jan 2003 23:38
I haven't actually tried this in DB but I think this should work:



/ Andreas Mattsson
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Jan 2003 00:00
I did think of trying something like that, but to be quite honest, it seemed like far too much work when SCREEN DEPTH() is already available

Login to post a reply

Server time is: 2025-05-17 02:52:54
Your offset time is: 2025-05-17 02:52:54