Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm now learning how to use directX (10 - 11), and i use materials from SDK samples, and But i find it suprising that none has explainded the transition between fullscreen and windowed. I also seached with google, in GameDevelopment and StackOverflow, but no result.

What i'm asking is explanation or full exaples for both Window and DirectX "classes".

Thanks for help.

share|improve this question
up vote -1 down vote accepted

You can do this using the normal Windows API function ChangeDisplaySettings

share|improve this answer
Not with D3D10/11 - use IDXGISwapChain::SetFullscreenState instead. – Le Comte du Merde-fou Dec 24 '12 at 17:02
@mh01, I've used this tutorial and double checked the source code for this answer, any reason why you shouldn't use the Windows API functions? They seem to work fine when I test it. – Roy T. Dec 24 '12 at 17:45
Mostly because SetFullScreenState is the method documented by Microsoft:…. It's generally good to follow the documentation I think, and the documentation should take precedence over a tutorial. – Le Comte du Merde-fou Dec 24 '12 at 23:26
there is nothing against using both. if you start your app and don't have a DirectX context yet, a lot of 3D Applications use ChangeDisplaySettings right after the window has been created to go fullscreen, and as soon as a context is available use SetFullScreenState for further adjustements – cppanda Dec 25 '12 at 1:16
@cppanda so once you have a DirectX context ChangeDisplaySettings no longer works? Should you use mh01's solution once you've already have a DirectX context? (In that case I think his answer is indeed better) – Roy T. Dec 25 '12 at 9:55

It actually turned out even simpler, I just recreated the DirectX device (or reset it) using new presentation parameters (windowed = false).

share|improve this answer
If this is the solution please accept it as answer. – bryan226 Dec 25 '12 at 0:00
Doesn't recreating the DirectX device have negative affects (maybe losing track of what is in GPU memory, I'm not sure but someone might be). – Roy T. Dec 25 '12 at 9:54

Your Answer


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.