Window focus callbacks
by Michael Cordner · in Torque Game Builder · 02/01/2006 (8:18 am) · 3 replies
Quick question, with all of the changes and the 1.4 integration, are there now callbacks for OS events such as window focus/loss of focus? The reason I'm asking is that I'd like to be able to pause the game and cut out the sound when the window focus is lost.
Thanks
Thanks
About the author
#2
In "winWindow.cc" (WindowProc)...
- Melv.
02/02/2006 (1:04 am)
About all I can add is that below is one way that's been used albeit under Windows only. It would be very useful to have this cross-platform.In "winWindow.cc" (WindowProc)...
case WM_ACTIVATE:
windowActive = LOWORD(wParam) != WA_INACTIVE;
if( Game->isRunning() )
Con::executef( 2, "windowFocusChanged", windowActive ? "1" : "0" );- Melv.
#3
02/02/2006 (12:56 pm)
Melv, You can maybe look at the SDL source code for ideas on a cross platform solution. They seem to have that down pretty good. I'm not saying cut n paste it, but to use as a reference ;D
Torque Owner Joe Rossi
Indri Games