Low FPS when TGE has no focus.
by Robert S. · in Torque Game Engine · 11/20/2005 (1:29 pm) · 1 replies
Hi.
If the TGE main screen is losing focus then the FPS is automatically going down. This is very disturbing if I open modal or modeless windows from C++. Can anybody tell me which piece of code is watching for the focus?
I tried to comment in void Platform::process() from winWindow.cpp the following code:
HWND window = GetForegroundWindow();
if (window && gWindowCreated)
{
// check to see if we are in the foreground or not
// if not Sleep for 100ms or until a Win32 message/input is recieved
DWORD foregroundProcessId;
GetWindowThreadProcessId(window, &foregroundProcessId);
if (foregroundProcessId != winState.processId)
MsgWaitForMultipleObjects(0, NULL, false, 100, QS_ALLINPUT);
}
but it had no effect on it. Any suggestion is welcome.
PS: I know that TGE has several features to build its own GUI, but it's not good for our app and for this reason I must use the C++ dialogs.
Thanks.
If the TGE main screen is losing focus then the FPS is automatically going down. This is very disturbing if I open modal or modeless windows from C++. Can anybody tell me which piece of code is watching for the focus?
I tried to comment in void Platform::process() from winWindow.cpp the following code:
HWND window = GetForegroundWindow();
if (window && gWindowCreated)
{
// check to see if we are in the foreground or not
// if not Sleep for 100ms or until a Win32 message/input is recieved
DWORD foregroundProcessId;
GetWindowThreadProcessId(window, &foregroundProcessId);
if (foregroundProcessId != winState.processId)
MsgWaitForMultipleObjects(0, NULL, false, 100, QS_ALLINPUT);
}
but it had no effect on it. Any suggestion is welcome.
PS: I know that TGE has several features to build its own GUI, but it's not good for our app and for this reason I must use the C++ dialogs.
Thanks.
About the author
Creator of VisitorVille.com
Torque Owner Dylan Fitterer
Forum Thread