Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I want to be able to allow players to switch between full-screen, windowed, and full-screen-with-a-borderless-window rendering modes. The last mode, borderless is an important one lots of players, myself included.

I have noticed that my game will stutter a little bit in borderless windowed mode. It's not terrible, but choppy gameplay can get slightly annoying and I want to it to be as smooth as it is in full-screen. I know other games have always had some issue with being borderless. I just figured since my game isn't that intensive I shouldn't see much of problem.

I am using David Amador's "XNA 2D Independent Resolution Rendering" code. The trouble comes when I create my gameplay screen and use the following code to create a borderless window:

Form gameForm = (Form)Form.FromHandle(curGame.control.Handle);
gameForm.FormBorderStyle = FormBorderStyle.None;

If I have it set to fullscreen through Amador's Resolution class then this borderless code doesn't seem to do anything at all. If I have it set to windowed it does work as expected and creates a borderless window. The only problem is that strange choppy behavior.

In full screen it doesn't lag one bit so I'm wondering if there's some issue with how the borderless code works. Is how I'm doing a borderless window correct? Am I just going to have to deal with a little bit of stuttering in that mode?

share|improve this question
4  
In borderless windowed mode it is drawing/updating the desktop and all of the open applications. Because of this your computer will be under heavier load than going full screen. So there is no way to avoid or even mitigate a performance hit. –  ClassicThunder Jan 14 '13 at 14:28
    
That makes sense, just wanted to be sure I was doing it alright and there wasn't something I could be doing better. Thanks for your input. –  Ted Jan 14 '13 at 20:25
add comment

1 Answer 1

You are seeing a performance difference due to the fact that in actual full-screen mode, you get exclusive access to the GPU for that adapter, so you won't have to content with any other process for that particular resource.

This may be slightly faster, but mostly it is just more predictable (and thus smoother), since nothing else will be allowed to make requests of the GPU that would cause it to hold any kind of lock on any resource or any kind of pipeline stall.

Those sorts of unpredictable, out-of-your-control demands are the cause for your occasional stutters when in full-screen windowed mode. It's akin to how loading all your game data from your disk will take longer if there is also another program (like a virus scanner) poking around at all those same files at the same time.

share|improve this answer
2  
Also in borderless windowed mode your app is still being passed through the DWM which can really screw with sync timings. –  Sean Middleditch Dec 3 '13 at 6:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.