Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AbrahamR), 717 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Retrieving monitor resolution #435132
01/03/14 10:40
01/03/14 10:40
Joined: Mar 2010
Posts: 120
Switzerland
T
TehV Offline OP
Member
TehV  Offline OP
Member
T

Joined: Mar 2010
Posts: 120
Switzerland
Hi,
I'm currently struggling with one of my menu screens - more specifically, the settings menu, where the user should be allowed to set their screen's resolution.
I have two problems with this:
-For one, I don't know the actual screen resolution, nor what resolutions are actually supported by their graphics device.
-Secondly, the application doesn't necessarily run on the primary monitor, so I need to be able to get the possible resolutions for the monitor that the application is being displayed on.

What I'm trying to do is create a drop-down menu where users can select the screen resolution they want. I want to include all resolutions their graphics device supports, and only those (no point in including a 1920x1080 option if their screen has a resolution of 1024x768, right?).

Is this possible? If so, how would I do this?

Thanks in advance,
~TehV

Re: Retrieving monitor resolution [Re: TehV] #435134
01/03/14 10:49
01/03/14 10:49
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
The actual screen resolution can be got with sys_metrics(0) and sys_metrics(1), see http://www.conitec.net/beta/asys_metrics.htm

Re: Retrieving monitor resolution [Re: oliver2s] #435135
01/03/14 11:10
01/03/14 11:10
Joined: Mar 2010
Posts: 120
Switzerland
T
TehV Offline OP
Member
TehV  Offline OP
Member
T

Joined: Mar 2010
Posts: 120
Switzerland
Thanks!
The manual says that those are the X and Y sizes of the primary monitor. Is it possible to retrieve the size of the second monitor using this function as well?

EDIT: The sys_metrics function appears to give me the wrong values. My screen resolution is 1920x1080, but sys_metrics gives me a resolution of 720x480.

Last edited by TehV; 01/03/14 11:41.
Re: Retrieving monitor resolution [Re: TehV] #435138
01/03/14 12:04
01/03/14 12:04
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Then use windows APIs, a short google session will help you out laugh
BTW you should run it BEFORE you start your game in fullscreen tongue

Last edited by Ch40zzC0d3r; 01/03/14 12:05.
Re: Retrieving monitor resolution [Re: Ch40zzC0d3r] #435171
01/03/14 17:10
01/03/14 17:10
Joined: Mar 2010
Posts: 120
Switzerland
T
TehV Offline OP
Member
TehV  Offline OP
Member
T

Joined: Mar 2010
Posts: 120
Switzerland
Running those functions before switching to fullscreen did the trick, I'm now getting the correct values. Should have seen that. Thanks!

I've tried to avoid using the Windows API but I'll have a look at it.

EDIT: For the resolution of the secondary monitor, one seems to have to go a bit of a detour:

Code:
var monitor2size_x = sys_metrics(78) - sys_metrics(0);
var monitor2size_y = sys_metrics(79);



Of course, this only works if the secondary monitor is larger in the Y direction than the primary monitor. If it is not, then the resolution will be incorrect in the Y direction.
I will investigate further to see if I can find a workaround to this.

Last edited by TehV; 01/03/14 17:44.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1