Alt Tabbing in Vista

Started by
3 comments, last by iterator 16 years, 4 months ago
I've got a strange problem in Vista when in fullscreen mode and I alt/tab between my engine and other apps. When I come back to the engine, the game is displaced halfway down the screen. The top half of the screen has the currently set clear color. I'm not missing the top half, rather, the whole graphics window has moved down. I've run this on dozens of XP machines of all types and this problem has never happened. Does anyone have any idea what might be causing this with Vista? I have checked the projection matrix before and after the alt/tab back and forth and it's fine. I've checked a bunch of other things, including resetting glViewport, but have run out of ideas. My graphics card is a GeForce Go 7950 GTX with the latest driver. The engine runs at 1024 x 768 so I'm toggling resolutions when I detect loss and regain of focus (I've tried responding to ACTIVATE_APP as well, but it made no difference), but as I said, I don't see this problem anywhere else.
Advertisement
Sounds very much like a driver bug to me, if you can create a simple reproduction case then do so and report it to Nvidia.
Don't be so quick to blame the drivers, sometimes drivers have some code in them that hide bugs(They are more forgiving than the specs), when a later version of the driver, like the Vista ones comes out without these failsafe, the driver is not really the problem, it's the game that makes a mistake, but it worked anyway because of a hack in the driver.

I've seen it happen, every thing works fine on NVidia, then you realize that on ATI it doesn't, you debug and realize you actually do something wrong.
That is a good point. But I think the approach here will be to try to run my app on other Vista machines and see what happens. And I'll also run some other OpenGL apps on the machine in question. I can't rule out my code just yet, but I can't rule out the driver either. This code has been running fine for several years on a large number of systems with very different card configurations. Second, the problem does not appear when running in DirectX mode, only OpenGL. Both modes use the same code to respond to the task switching. I know this isn't proof of anything, but it's definitely curious.
I was able to remove the problem by doing a SetWindowPos after activation to move the graphics window to where it should be (0, 0, width, height). Somehow the window placement gets screwed up when alt-tabbing. There is no such code in my app that would do that, so I'll be looking into this further, but for now at least I don't get the problem.

This topic is closed to new replies.

Advertisement