Non Focused Direct3D Window?
When i create a D3D window and display a triangle or anything like that, and then i blur the window (ie bring something else into focus other than the animation window), it lags my pc, the mouse jerks about over the screen and my pc almost freezes...
Trying to close the window manually is sometimes too slow so i have to resort to ctrl alt del.
Anyone know any good code i can put in the winproc to stop this happening when it doesnt have focus, and what implications would that have if someone say pressed the window key (if this was an actual game)
Regards,
case WM_ACTIVATEAPP: bool fActive; fActive = (bool)LOWORD(wparam); if (mysub) { if (fActive == FALSE) { mysub->OnAppLostFocus(); } else { mysub->OnAppGainFocus(); } }
When your app is "Lost Focus", unaquire the device, and stop rendering, and slow down the game loop to like 100ms per interation. Thats what I do. Works fine for me. Make sure you you still call the GetMessage/TranslateMessage while its in the slowdown state. Otherwise the app might not get focus back.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement