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'm now learning how to use directX (10 - 11), and i use materials from SDK samples, http://www.rastertek.com/ and http://takinginitiative.net/category/graphics-programming/directx-10-tutorials. 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

2 Answers 2

up vote 0 down vote accepted

You can do this using the normal Windows API function ChangeDisplaySettings http://msdn.microsoft.com/en-us/library/windows/desktop/dd183411(v=vs.85).aspx

share|improve this answer
1  
Not with D3D10/11 - use IDXGISwapChain::SetFullscreenState instead. –  Jimmy Shelter Dec 24 '12 at 17:02
1  
@mh01, I've used this tutorial rastertek.com/tutdx11.html 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
1  
Mostly because SetFullScreenState is the method documented by Microsoft: msdn.microsoft.com/en-us/library/windows/desktop/…. It's generally good to follow the documentation I think, and the documentation should take precedence over a tutorial. –  Jimmy Shelter 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

 
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.