Game Development Community

Alt-Tab Crash

by Alex Stone · in Torque Game Engine · 04/21/2008 (10:21 am) · 30 replies

**SEE THREE POSTS DOWN FOR FIX**

Game crashes on Windows Vista and Windows XP when you alt-tab out and then back into a game while it is full-screen and using the OpenGL render driver. This is confirmed happening with an unmodified distro of the Torque SDK.

I checked with GG staff and they believe the problem may have to do with mode switching.

Stack Trace (note my line numbers may by slightly different than yours):


First-chance exception at 0x6bda834f in torqueDemo_DEBUG.exe: 0xC0000005: Access violation reading location 0x6bda834f.

Unhandled exception at 0x6bda834f in torqueDemo_DEBUG.exe: 0xC0000005: Access violation reading location 0x6bda834f.



user32.dll!GetMessageW() + 0x6e bytes

user32.dll!GetMessageW() + 0x146 bytes

user32.dll!GetMessageW() + 0x261 bytes

user32.dll!OffsetRect() + 0x4d bytes

ntdll.dll!KiUserCallbackDispatcher() + 0x2e bytes

user32.dll!MsgWaitForMultipleObjectsEx() + 0xc5 bytes

> > torqueDemo_DEBUG.exe!ProcessMessages() Line 912 + 0x14 bytes C++

torqueDemo_DEBUG.exe!Platform::process() Line 935 + 0x5 bytes C++

torqueDemo_DEBUG.exe!DemoGame::main(int argc=1, const char * * argv=0x001c2148) Line 451 C++

torqueDemo_DEBUG.exe!run(int argc=1, const char * * argv=0x001c2148) Line 1398 + 0x1c bytes C++

torqueDemo_DEBUG.exe!main(int argc=1, const char * * argv=0x001c2148) Line 1467 + 0xd bytes C++

torqueDemo_DEBUG.exe!__tmainCRTStartup() Line 327 + 0x19 bytes C

torqueDemo_DEBUG.exe!mainCRTStartup() Line 196 C

kernel32.dll!BaseThreadInitThunk() + 0x12 bytes

ntdll.dll!LdrInitializeThunk() + 0x4d bytes



This crash occurs on a variety of WinXP/Vista machines with different rendering hardware Including Nvidia and ATI.

How to replicate on your copy:

Run torqueDemo.exe.

Open the options dialog.

Check the Fullscreen box.

Click apply.

Wait for everything to reload.

Press Alt-Tab.

Press Alt-Tab again OR click on the game window in the Task Bar.
Page«First 1 2 Next»
#21
01/08/2009 (8:29 am)
Tried on 1.7.3 and it doesn't works :(

What should I do?

Thanks
#22
01/08/2009 (8:48 am)
It worked for me on both 1.7.3 and 1.7.4
since I just did it on 1.7.4 I can tell you what I did.
I actually uninstalled 1.7.4 to get rid of any other crap I had there and reeinstall a fresh version.
I build 1.7.4 as is to make sure it works. the build worked and I still had the full-screen crash.
than I followed alex's post (#4) exactly the way it is. build again and tried it. this time I didn't have the crash.
Did you modified the source code and re-build TGBGame? if so, did you copy the new TGBGame.exe into your project?
#23
01/08/2009 (9:29 am)
I don't know what happened:

I try the game before any fix and TGB crashes. Then I did the fix and the game also crashes. Then I undo any change in the cc files and save them again. Then I've tried the game again and now it is working (something really nice but can't understand why since I've undone the fix file changes...).

Well, at least the game is working now with the ALT-TAB in fullscreen mode :)

Thanks!
#24
01/08/2009 (9:41 am)
A good test would be starting the game in full screen. but beore the fullscreen actualy loads try minimze the game from the taskbar, or just put some other windows in focus (on top of you game window). this usually crash it too unless you use the fix.
Glad it works for you though.
#25
05/08/2009 (8:23 pm)
Fix works. Thanks! Has anyone figured out how to make the desktop revert back to its original resolution when the game is minimized following an alt-tab from full screen mode?. Currently, the desktop resolution is left at game screen resolution, which looks pretty bad. I know when you toggle from fullscreen to windowed mode it reverts the desktop back to its original resolution (as expected), but I'm not a C++ programmer and I can't track that down in the code. Any help here would be greatly appreciated.

Okay, found it myself. in winWindow.cc after the newly added "Platform::minimizeWindow();", the "video::deactivate();" function still needs to be called. restoreTheTaskbar(); used to be called here as well. Do we need that, too?

else if(Video::isFullScreen())
{
Platform::minimizeWindow();
Video::deactivate();
}
#26
09/04/2009 (12:33 pm)
When I'm in full screen mode, hitting alt-tab you doesn't display the "program selection thumbnails". in window mode it works fine. do you guys know how to fix that?
I've submitted my game to bigFish and I can't passed their QA because of that bug. they want to see program selection also on full screen.
#27
09/04/2009 (12:36 pm)
I think another community member (Maybe Amanda Fitch) solved that issue for her releases. I'll do some searching and see if I can find it. I know that they solved some sticky portal issues, but I cannot recall if this was one of them (or if it was a requirement then).
#28
09/04/2009 (5:25 pm)
Thank David. I was able to pass their QA with a previous game , but I guess I got lucky.
The main bug is the crash which is 99% fixed now. it is still crashing on some machines, but rare.
The one last bit, is the "program selection" which only works on window mode. There are quite a few TGB games on BFG so I'm sure I'm not the first one to have this problem.
#29
09/07/2009 (8:08 am)
[A bit OT]

Hi Eyal,
we'd like to submit our game to BFG also so, if it's not under NDA, could you post the QA tests they use? It will be really useful to have the ability to check those tests by ourself before submitting.

#30
09/07/2009 (2:25 pm)
I can give you a general list that most big portals requires.
1. Alt-Tab , definitely use the fix posted here by alex stone (post #4) since the game shouldn't crash when pressing alt tab.
2. Alt-Tab or any other change of focus should pause the game and music
3. ESC should pause the game and music.
4. If you have any game options (full-screen/window sfx volume, resolution , etc..) they should be saved so next time you play it, you would use the same options.
5. alt-tab "program selection thumbs" should work properly.
6. game should launch in full-screen.
7. no hot or cold html link.
8. all icons should display properly in desktop/start menu/add/remove program
9.alt-F4 quits the game
10. task manager works properly.
11. in general the game should work just like any other program.

off the top of my head that's what I remember as the main issues.
If you are just submitting the game for review none of these really matters since they only care to see if it's a good match for them. once the game has been approved they will send you a .doc with all their specific requirements as far as splash screen and everything else I've mentioned.

Page«First 1 2 Next»