Jump to content
  • Advertisement
Sign in to follow this  
Karadok

Toggle Fullscreen

This topic is 4493 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, maybe you can help me. I search for a tutorial that shows how to toggle fullscreen in directX 9 with c++.

Share this post


Link to post
Share on other sites
Advertisement
I'm sure the samples that come in the SDK show it, though sometimes they're not exactly clear.

You need to use SetWindowLong to change the window style. You need to use SetWindowPos, with the flag SWP_FRAMECHANGED, to make the style changes take effect.

You change your D3D presentation parameters to include the new backbuffer size you want (ClientRect of window, or resolution of full screen mode), set windowed to true or false, and do a Reset on your D3D device, passing the new presentation parameters in.

Share this post


Link to post
Share on other sites
In addition to what the person above me said, you will lose all your resources like textures, buffers and the like. I'm not sure if you knew this already, but toggling between fullscreen and windowed acts as your device has been lost, so you need to release your resources and load them again.

Share this post


Link to post
Share on other sites
Thank you, i now that. I make a reset when i resize the window. it works well but when i want to toggle into fullscreen the program closes the window. I need a tutorial. That one i found isn`t good.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!