Game Development Community

Get the desktop resolution upon game launch?

by Joe Williams · in Torque Game Builder · 08/07/2009 (10:25 am) · 2 replies

I apologize if this has been asked/answered before, but I can't find this info through searching.

Is there a torquescript command that can get the current screen resolution when the game launches? By this, I mean, if a user's desktop resolution is 1024x768, is there a command that can be used to get this info for the game when it launches?

The reason I'd like to know is that I'm making a game that can run on netbooks, which have a resolution of 1024x600. For this to work, the game has to run at full screen. If I just leave that as the default setting and require non-netbook users to change it after launching the game, forcing the 1024x600 resolution full screen will look bad and may disturb the player. If the game could get the desktop resolution upon launch, I could write it so it changes between running in full screen or windowed mode accordingly.

#1
08/08/2009 (10:38 am)
%info = getDesktopResolution();
%width = getWord(%info, 0);
%height = getWord(%info, 1);
%depth = getWord(%info, 2);
#2
08/08/2009 (4:46 pm)
Thanks!