MS Vista crashes
by Pavel Tovarys · in Torque Game Builder · 04/27/2007 (4:04 pm) · 13 replies
Hello,
When testers played our older games on MS Vista, the games crash when they pres ALT-TAB or CTRL-ALT-DELETE. Any idea how to fix it?
Thanks,
Pavel T..
When testers played our older games on MS Vista, the games crash when they pres ALT-TAB or CTRL-ALT-DELETE. Any idea how to fix it?
Thanks,
Pavel T..
#2
04/29/2007 (3:22 am)
Yes, but my question was how to fix it? In a script? Or in a code? And how? Thanks..
#3
You need to check if the context got killed and recreate it. This means recreation of the whole graphics end and if Torque does not cache textures in System ram, reload all textures.
04/29/2007 (5:00 am)
You must do it in code.You need to check if the context got killed and recreate it. This means recreation of the whole graphics end and if Torque does not cache textures in System ram, reload all textures.
#4
04/29/2007 (10:57 pm)
See my post below...
#5
Is TGB supposed to be compatible with Vista? If it isn't, when it is going to be? We are required to launch our game on Vista as well, so this is quite a predicament for me right now... :D
05/08/2007 (9:59 pm)
Some people tested our game on Vista and had the same problem. I'm not familiar at all with the Vista model, does amaranthia's code completely fixes the problem? I'm worried about Marc's remark on having to reload all textures.Is TGB supposed to be compatible with Vista? If it isn't, when it is going to be? We are required to launch our game on Vista as well, so this is quite a predicament for me right now... :D
#6
You can run it as it is a Windows Version but it is known to have problems, no mather if TGB / TGE or TGEA in the end, just that TGE/TGB will die and TGEA has annoying flicker through issues.
Just to mention: the ctrl-alt-del will break it on Win2k / XP as well if the behavior is not set to show the process manager instead of the admin panel from 2k. The same fixes are needed there as they are needed on vista ...
alt-tab only works on XP because no 3D context is used, so for same behavior, disable the windows theme (aero and vista basic) and it will behave the same as the classic is running on CPU. (yes no solution, just to show where the problem comes from)
*no guarantee to be right, but that were the problems I had to fight last with a DX7 engine where no source was present and some tricks were needed*
05/08/2007 (11:48 pm)
No Torque technology is supposed to be compatible to vista yet, according an employee posting on the TGEA boards some time ago.You can run it as it is a Windows Version but it is known to have problems, no mather if TGB / TGE or TGEA in the end, just that TGE/TGB will die and TGEA has annoying flicker through issues.
Just to mention: the ctrl-alt-del will break it on Win2k / XP as well if the behavior is not set to show the process manager instead of the admin panel from 2k. The same fixes are needed there as they are needed on vista ...
alt-tab only works on XP because no 3D context is used, so for same behavior, disable the windows theme (aero and vista basic) and it will behave the same as the classic is running on CPU. (yes no solution, just to show where the problem comes from)
*no guarantee to be right, but that were the problems I had to fight last with a DX7 engine where no source was present and some tricks were needed*
#7
Thanks,
Juan Gril
Producer
Joju
05/10/2007 (9:26 pm)
Can we get an update from GarageGames on this issue? Portals are putting our latest game on hold because it crashes when we do ALT-TAB on Vista. I'm sure everybody else will not be able to launch their games on many portals who are asking for full Vista compatibility, so this is a pretty serious matter.Thanks,
Juan Gril
Producer
Joju
#8
The problem is because you are continuing to attempt to draw when the drawing surface is locked.
This can be solved very simply by "deactivating" your application when you loose focus.
To do this, simply follow these steps:
1) Open "winWindow.cc" in the Torque Game Builder "Engine" sources.
2) Scroll down to the "WindowProc" function.
3) Scroll down further to the WM_ACTIVATEAPP case.
4) As the wParam of this message indicates the activation (or deactivation), simply apply the following call in the deactivation ("false" case) of this test so:
5) Before you attempt to compile, you will need to put the following "extern" reference above the call (typically at the top of the file for clairity, but anywhere above the call is all that is required):
extern void GameDeactivate ( bool noRender );
And with this, you no longer have the crash on Alt-Tab, nor Alt+Ctrl+Del, nor Windows Key + L, nor...
Enjoy...
05/10/2007 (10:58 pm)
Hey everyone, we had the same problem here. Portals would not launch our game until the problem was fixed. Luckily, my partner, Bryce, is very good at debugging things like this, and he found a very simple answer. Here is his message for everyone:The problem is because you are continuing to attempt to draw when the drawing surface is locked.
This can be solved very simply by "deactivating" your application when you loose focus.
To do this, simply follow these steps:
1) Open "winWindow.cc" in the Torque Game Builder "Engine" sources.
2) Scroll down to the "WindowProc" function.
3) Scroll down further to the WM_ACTIVATEAPP case.
4) As the wParam of this message indicates the activation (or deactivation), simply apply the following call in the deactivation ("false" case) of this test so:
if ((bool) wParam)
{
// Do your activation code...
}
else
{
// Whatever else you need or care to do on deactivation here...
GameDeactivate(true);
}5) Before you attempt to compile, you will need to put the following "extern" reference above the call (typically at the top of the file for clairity, but anywhere above the call is all that is required):
extern void GameDeactivate ( bool noRender );
And with this, you no longer have the crash on Alt-Tab, nor Alt+Ctrl+Del, nor Windows Key + L, nor...
Enjoy...
#10
Thanks again,
Nicolas
05/11/2007 (12:22 pm)
Amaranthia, thanks a lot for your post. But I still have doubts where exactly to add that line, since I don't know what the rest of the code is supposed to do. Could somebody please look at this code and tell me if it's okay? It is the original sourcecode with amaranthia's line at the end of the else.case WM_ACTIVATEAPP:
if ((bool) wParam)
{
Video::reactivate();
ShowCursor(false);
if ( Video::isFullScreen() )
hideTheTaskbar();
// HACK: Windows 98 (after switching from fullscreen to windowed mode)
SetForegroundWindow( winState.appWindow );
// If our keyboard state is dirty, clear it
if( sgKeyboardStateDirty == true )
{
sgKeyboardStateDirty = false;
InitInput();
}
}
else
{
// Window lost focus so set a dirty flag on the keyboard state
if ( lParam == 0 )
sgKeyboardStateDirty = true;
Video::deactivate();
restoreTheTaskbar();
GameDeactivate(true); // FIX FOR WINDOWS VISTA.
}
break;Thanks again,
Nicolas
#11
I've only tested the TGB build on Windows XP Professional, since I don't own Vista yet. Maybe the fix works on Vista but not on XP?
05/13/2007 (8:21 pm)
Guys, I tried the code I posted on the previous message and the debug build of TGB seems to work fine but the release build doesn't. The problem is when the game switches between window and fullscreen mode, it doesn't matter if its from window to full screen or viceversa, I get no video output whatsoever, just a black screen. I'm using the torquescript function toggleFullScreen() to switch video modes, so I guess the changes on WM_ACTIVATEAPP and toggleFullScreen() don't go well together.I've only tested the TGB build on Windows XP Professional, since I don't own Vista yet. Maybe the fix works on Vista but not on XP?
#12
Thanks!
07/09/2007 (1:37 pm)
I tested it under Vista and have the same problem. Anybody knows how to fix it?Thanks!
#13
11/20/2007 (2:02 am)
Hi, anybody solve this problem? I have still no idea how to fix it :( Anybody can help me?
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
same for alt-tab which on vista enforces DX
you will have to use the code an manually recreate the graphic context in this case