Game Development Community

Running TGB in a window, without focus

by Jason Swearingen · in Torque Game Builder · 03/11/2006 (11:36 pm) · 4 replies

I think I have a compelling reason for running TGB in a window, without focus.

Currently, doing this messes up the simulation due to what appears to be prioritzation issues.

There is a TGE post on the subject: http://www.garagegames.com/mg/forums/result.thread.php?qt=32525

but unfortnatly I can not read it due to not owning TGE.

Is there a workaround for this?


Thanks,

-Jason

#1
03/12/2006 (12:07 am)
From that post;

Quote:
To keep the engine running at full speed even when its window does not have focus:
1) search for this code in winWindow.cc:


if (foregroundProcessId != winState.processId)
         MsgWaitForMultipleObjects(0, NULL, false, 100, QS_ALLINPUT);


2) Comment that code out. It puts the engine to sleep for 100ms.

Should work fine in T2D too, but I haven't tried.
#2
03/12/2006 (2:05 am)
Cool, thanks much for that. seems simple enough!
#3
03/12/2006 (2:58 am)
I think this is depricated. Since the 1.4 merge this can be changed from script.
Just set $Pref::backgroundSleepTime to some low value (zero?).
#4
03/12/2006 (12:26 pm)
Even better! much thanks to both of you.