Game Development Community

getDesktopResolution in 1.7.5

by Juan Fco Campos · in Torque Game Builder · 07/01/2010 (5:09 pm) · 9 replies

It seems like getDesktopResolution() has been changed.

I use it to match my game's resolution to the system's resolution.

With 1440x900, it returns 1440x860 (in Windows 7)

1280x800, windows xp, it returns 1280x772.

It's the taskbar, right? How can I figure out the exact system resolution?

Hope there's a better solution than add 32 or 40 to the height...



About the author

Melee Studios www.melee-studios.com

Recent Threads


#1
07/02/2010 (5:29 am)
I solved it changing the code in the getDesktopResolution function.

I use GetSystemMetrics instead.
#2
07/31/2010 (9:27 pm)
Any chance we could see the code?
#3
08/04/2010 (8:43 pm)
Hi, here is the code:

in winWindow.cc, "Video::getDesktopResolution()" function, in line 1318

Original code:
Result.w = winState.desktopClientWidth;
   Result.h = winState.desktopClientHeight;
   Result.bpp = winState.desktopBitsPixel;

Modified code:

Result.w = winState.desktopClientWidth;
   //Result.h = winState.desktopClientHeight;
   Result.bpp = winState.desktopBitsPixel;

   Result.h = GetSystemMetrics(SM_CYSCREEN);

I use GetSystemMetrics only for the height.

Hope this help!
#4
08/10/2010 (8:49 am)
I was messing around and found the function. Did a few tests and came up with the same solution. It's nice to see that you came up with the same code.

Have you tried this with the sidebar on in Vista?
#5
08/10/2010 (11:55 am)
Nice :)

No I didn't, but I think It should work.

I'll post if I find any error!
#6
11/11/2011 (5:09 am)
I'm having the same problem, but I'm afraid I'm not that experienced to perform a recompile, it is too complex to me.

Any ideas?
#7
11/11/2011 (7:25 am)
Hopefully this is one of the things that will be fixed in the 1.7.6 version that's coming.
#8
11/11/2011 (7:30 am)
Amjad, you should give it a try... all this "recompile" thing sounds complex but it's not :)

I don't know another way to fix it.

#9
11/11/2011 (10:04 am)
Thanks Juan, if you could do me a favor and tell me in your own simplified words the exact steps of doing a recompile. That would be great and most appreciated. The steps on TDN seems complex and sometimes out of date. I mean which compilers I should install for TGB 1.7.5, what SDK etc.

Thanks in advance.