Finally, TGB works in Vista
by Bruno · in Torque Game Builder · 07/28/2009 (2:34 am) · 7 replies
Some of you may remember some of my posts regarding TGB and Vista , and some may have experienced crashes of TGB in Vista.
TGB out of the box, crashes in Vista, when AERO is turned on, and will crash when the system is locked.
Some portals will refuse the game, until this is fixed.
My game got refused from BigFish because of this problem.
Anyways, the fix to get TGB working in Vista, is the following :
In these files:
winD3DVideo.cc and winOGLVideo.cc
Find the setScreenMode method, and then find this line:
test = ChangeDisplaySettings( &devMode, CDS_FULLSCREEN );
and add the following lines immediately after it:
while ( test == DISP_CHANGE_FAILED)
{
Sleep(500);
test = ChangeDisplaySettings( &devMode, CDS_FULLSCREEN );
}
Many thanks to Gerald for this fix, the game just passed BigFish QA.
Works like a charm :)
I hope it's usefull to someone that has the same problem.
TGB out of the box, crashes in Vista, when AERO is turned on, and will crash when the system is locked.
Some portals will refuse the game, until this is fixed.
My game got refused from BigFish because of this problem.
Anyways, the fix to get TGB working in Vista, is the following :
In these files:
winD3DVideo.cc and winOGLVideo.cc
Find the setScreenMode method, and then find this line:
test = ChangeDisplaySettings( &devMode, CDS_FULLSCREEN );
and add the following lines immediately after it:
while ( test == DISP_CHANGE_FAILED)
{
Sleep(500);
test = ChangeDisplaySettings( &devMode, CDS_FULLSCREEN );
}
Many thanks to Gerald for this fix, the game just passed BigFish QA.
Works like a charm :)
I hope it's usefull to someone that has the same problem.
About the author
#2
07/28/2009 (4:02 am)
Wow, very nice! Thanks a ton for sharing!
#3
Because the system is changing to a new "desktop" when you Ctrl-Alt-Delete or lock the computer from the start menu, and for whatever reason the engine tries to adjust the resolution, when in full screen mode it is attempting to change the display settings for a desktop that is no longer active which results in DISP_CHANGE_FAILED under Aero.
There are are only a handful of things that will result in DISP_CHANGE_FAILED, most of which are rare and involve wonky display drivers, so it's probably mostly safe to use this code, which just sleeps until ChangeDisplaySettings no longer returns DISP_CHANGE_FAILED.
But a more graceful solution would probably be useful :P
If Torque2D is using the same framework as Torque3D then it won't be an issue with that version when it's released.
07/28/2009 (4:31 am)
This isn't the most elegant solution, but it works and it's very simple :p I'll probably look into a more "proper" solution here soon, but just in case somebody else does sooner, I'll give a little info about why that was happening.Because the system is changing to a new "desktop" when you Ctrl-Alt-Delete or lock the computer from the start menu, and for whatever reason the engine tries to adjust the resolution, when in full screen mode it is attempting to change the display settings for a desktop that is no longer active which results in DISP_CHANGE_FAILED under Aero.
There are are only a handful of things that will result in DISP_CHANGE_FAILED, most of which are rare and involve wonky display drivers, so it's probably mostly safe to use this code, which just sleeps until ChangeDisplaySettings no longer returns DISP_CHANGE_FAILED.
But a more graceful solution would probably be useful :P
If Torque2D is using the same framework as Torque3D then it won't be an issue with that version when it's released.
#4
But now it's running on a x64 XP, and it works WAY better!
07/28/2009 (12:52 pm)
Wait... There was an issue with TGB and Vista? I never found any problems with it running on my 32-bit Business...But now it's running on a x64 XP, and it works WAY better!
#5
thank you for sharing tho.
07/28/2009 (2:20 pm)
there were (are) issues with TGB in vista... and there have been a few workarounds... this one looks like a fancy one, but i've implemented the one shared by amaranthia... an so far, so good.thank you for sharing tho.
#6
07/28/2009 (2:40 pm)
No, seriously, I just installed my TGB 1.7.4 and it ran perfectly. The only thing that I think that isn't necessary but I had to do was to save the level and reload the project before running the game.
#7
07/28/2009 (4:26 pm)
TGB runs fine in Vista normally. The problem that this addresses occurs if you have Aero enabled, and the game is in fullscreen mode, and you press Ctrl-Alt-Delete, which causes the game to crash. The issue is somewhat timing sensitive so it doesn't happen on all systems, but it happens on enough of them that your game will not pass QA on Big Fish and other portals.
Torque Owner Kostiantyn Teterin