Getting the resolution of the game window
by Keith Johnston · in Torque 3D Professional · 10/28/2009 (1:31 am) · 3 replies
How can I get the resolution of the current game window, whether it is in windowed mode or fullscreen?
#2
This worked for me in TGEA:
In resol.x and resol.y, you should get resolution.
Hope this helps.
10/28/2009 (9:17 am)
Hello.This worked for me in TGEA:
#include "gui/3d/guiTSControl.h"
GuiTSCtrl *tsCtrl;
tsCtrl = dynamic_cast<GuiTSCtrl*>( Sim::findObject("PlayGui") );
Point2I resol = tsCtrl->getExtent();In resol.x and resol.y, you should get resolution.
Hope this helps.
#3
10/29/2009 (10:37 pm)
The Canvas did the trick - this worked, thanks!GuiCanvas *canvas = NULL;
if (Sim::findObject( "Canvas", canvas ) )
{
Point2I currentRes = canvas->getWindowSize();
...
}
Associate Phillip O'Shea
Violent Tulip
If you do a dump in the console, Canvas.dump();, you will see the full list of methods available.