|
Re: sys_metrics(0) and sys_metrics(1) not showing the correct values
[Re: delinkx]
#224952
09/02/08 07:15
09/02/08 07:15
|
Joined: Feb 2002
Posts: 288 California, USA
jaknine
OP
Member
|
OP
Member
Joined: Feb 2002
Posts: 288
California, USA
|
function get_Desktop()
{
theDesktopWidth = sys_metrics(0);
theDesktopHeight = sys_metrics(1);
}
panel screen_size_panel =
{
digits(10,10,"width: %.1f","Arial#16b",1,theDesktopWidth);
digits(10,30,"height: %.1f","Arial#16b",1,theDesktopHeight);
flags = VISIBLE, refresh;
layer = 60;
}
Then I call get_Desktop(); in the code. No matter what I set my desktop resolution to the panel always says it's 1280x1024.
|
|
|
Re: sys_metrics(0) and sys_metrics(1) not showing the correct values
[Re: delinkx]
#224970
09/02/08 10:52
09/02/08 10:52
|
Joined: Jul 2008
Posts: 1,178 England
MrGuest
Serious User
|
Serious User
Joined: Jul 2008
Posts: 1,178
England
|
i dont find any problem with this. it should be running fine. the variables "theDesktopWidth" and "theDesktopHeight" are declared global ? Without it being declared as global, it'd return 0. I've tested your code and have it working on mine, are you sure that your pc isn't set up for 2 monitors, and it's reading the values of monitor 1 though it doesn't exist? It's the only think I can think of
|
|
|
Re: sys_metrics(0) and sys_metrics(1) not showing the correct values
[Re: MrGuest]
#225138
09/03/08 00:25
09/03/08 00:25
|
Joined: Feb 2002
Posts: 288 California, USA
jaknine
OP
Member
|
OP
Member
Joined: Feb 2002
Posts: 288
California, USA
|
I only have the one monitor and I checked my card settings to verify that it's not seeing two. I made a completely new project to test this out and it's still not giving the results I would expect. This time it does actually change the results it gives, but they are off. For instance, if I set the desktop to 800x600 or 1024x768, it shows 640x480 on the panel. If I set the desktop to 1152x864 or even 1280x1024, it shows 1024x768 on the panel. In other words, even in this completely new project it's not giving the expected readings. Here is the project, zipped up, if anyone wants to take a look and see what I'm doing wrong. - http://www.jaknine.com/3dgs/test.zipThanks for the help.
|
|
|
|