Jump to content
  • Advertisement
Sign in to follow this  
vacatola

resizing a window in-game (settings menu)

This topic is 4815 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

I am running directx 9 and have been able to enumerate my device to see what modes and resolutions i can run in. However, I am having trouble with actually resizing my window. I am using win32 with C++, but I was wondering if there was a way to change the window size and resolution with directx, or if it has to be in win32...and if you know an effective way to do it, post some code please!

Share this post


Link to post
Share on other sites
Advertisement
I assume that you want to do a fullscreen resolution change. If that is the case, check out your D3DPRESENTPARAMETERS. Update BackBufferWidth, and BackBufferHeight to their new values, and then perform a device reset (IDirect3DDevice9::Reset()). Something along these lines:


presentParams.BackBufferWidth = newWidth;
presentParams.BackBufferHeight = newHeight;

if( FAILED( d3dDevice->Reset( &presentParams ) ) )
{
...
}

Share this post


Link to post
Share on other sites
will this only work in full screen mode? also, should i do device->EndScene() before reseting the device then device->BeginScene() afterwards? i am still having troubles with it. it is working in full screen mode. are there other properties that are necessary to be changed? i've tried changing to the new format and it doesn't help either

[Edited by - vacatola on September 14, 2005 9:56:23 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by vacatola
will this only work in full screen mode? also, should i do device->EndScene() before reseting the device then device->BeginScene() afterwards? i am still having troubles with it. it is working in full screen mode. are there other properties that are necessary to be changed? i've tried changing to the new format and it doesn't help either

You should (check for lost device/reset device) outside the BeginScene/EndScene pair, I think. If the device doesn't reset, you should make sure you've released any D3DPOOL_DEFAULT objects and if it still doesn't work, check the debug output and it will tell you the problem.

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!