SetScreenMode/Focus Crash [Resolved(?)]
by Justin Proffitt · in Torque Game Builder · 09/24/2011 (8:20 pm) · 2 replies
I appear to have ran into a bit of trouble. I discovered that whenever setscreenmode is called in one level of my game, the program crashes completely. This includes when the game is full screen and I alt tab out of it and attempt to return to it; it only crashes upon returning to it. There is nothing explicitly distinctive about this level, it contains t2dSceneObjectGroups and t2dSceneObjects. According to the console the crash appears to be at the line "Making the new rendering context current..." in the case of calling setscreenmode, and then there is no indication of crashing when returning to the program.
I am very perplexed, I wouldn't mind just circumventing the issue as long as I knew what was happening. However on my own I haven't a clue of figuring out what is causing this.
What I do know:
I am on a windows Vista (Aero disabled)
My graphics drivers are up to date (Card: ATI 5450)
I would appreciate absolutely any help, thank you.
Edit: I broke down the level and reconstructed it bit by bit, and the problem suddenly vanished. I suspect I may have done something wonky when adding objects directly into the code. I know I also make extensive use of objects that t2d doesn't completely support so I believe this might've been a result of those two things. I don't believe anyone else will have this exact issue.
I am very perplexed, I wouldn't mind just circumventing the issue as long as I knew what was happening. However on my own I haven't a clue of figuring out what is causing this.
What I do know:
I am on a windows Vista (Aero disabled)
My graphics drivers are up to date (Card: ATI 5450)
I would appreciate absolutely any help, thank you.
Edit: I broke down the level and reconstructed it bit by bit, and the problem suddenly vanished. I suspect I may have done something wonky when adding objects directly into the code. I know I also make extensive use of objects that t2d doesn't completely support so I believe this might've been a result of those two things. I don't believe anyone else will have this exact issue.
About the author
I am a college student majoring in physics. As it so happens I like programming, a hobby which extends my profession in web design.
#2
09/25/2011 (4:47 pm)
Thanks for showing me that code, that solves a problem down the road when I need to force the game to pause. Unfortunately the crashing persists. When I have time, I'll try reconstructing the level piece by piece until it crashes again, then go from there.
Torque Owner Playboom Entertainment
this my code in game.cs
//--------------------------------------------------------------------------------------------- // Pause game when player navigates away from game window // -isFocused: 0=game window not focus, 1=game window is focus //--------------------------------------------------------------------------------------------- function onWindowFocusChange(%isFocused){ // pause game if (!%isFocused){ pauseWindow(1); //your own pause function if(isFullscreen()){ minimizeWindow(); } // unpause game }else{ pauseWindow(0); //your own pause function if(isFullscreen()){ restoreWindow(); } } }