Jump to content
  • Advertisement
Sign in to follow this  
stupid_programmer

Change Screen Res During Execution

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

When changing the screen res while the app is running do we need to change the size of the parent (HWND) window to match the new res? I'm trying to support the wide screen formats but since all I got is a CRT they look strange. So I'm wondering if its just the monitor/graphics card combo or I'm missing something.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
do we need to change the size of the parent (HWND) window..?

I'm not sure why you'd do that. It should be left up to the user.

Or am I misunderstanding your question?

Share this post


Link to post
Share on other sites
Shouldn't the entire window be destroyed and recreated with everything matching the new res? I think that's how it normally done, I never seen anything that could change res while the window is active or I could be stupid.

Share this post


Link to post
Share on other sites
Quote:
Shouldn't the entire window be destroyed and recreated with everything matching the new res?

If a DirectX app run loop is setup correctly, responding to window sizing and lost devices, everything will take care of itself.

I don't destroy the app window until the user closes it. The window itself will "survive" the resolution change; the device will be lost and the app resets it and the app continues.

Share this post


Link to post
Share on other sites
Sorry, probably not worded the best. My menu is a fixed res though you can select what res the actual game plays in. So when the player enters the game the screen res may need to change based on which res they selected. Currently I release both IDirect3D9 and IDirect3DDevice9 then proceed to create them again using the old window handle with the new res which also calls D3DXMatrixPerspectiveFovLH() where FOV is 45 degrees and the aspect ratio is figured from the given scree res. What I'm wondering is if I need to resize the Win32 window along with the new screen size since it was created with the dimensions for the menu. The game is also only ran in fullscreen.

Share this post


Link to post
Share on other sites
Going to bump this just once.

I don't have access to any widescreen monitors so I can't just test the code to see if it works. Is what I'm doing all thats needed to change res while the program is running?

Share this post


Link to post
Share on other sites
Firstly, don't destroy the entire device. That's like restarting your PC when you change screen resolution. Just call IDirect3DDevice9::Reset() with the present params set up to match the new resolution.

In fullscreen mode, you don't need to resize the window to match D3D's size, but you will in windowed mode.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
In fullscreen mode, you don't need to resize the window to match D3D's size, but you will in windowed mode.

Well, you don't have to, but then the backbuffer will get squeezed or stretched in the mismatched sized window.

Share this post


Link to post
Share on other sites
Quote:
Original post by Mike nl
Quote:
Original post by Evil Steve
In fullscreen mode, you don't need to resize the window to match D3D's size, but you will in windowed mode.

Well, you don't have to, but then the backbuffer will get squeezed or stretched in the mismatched sized window.
Are you sure? I've not seen this happening - I thought D3D changes the display mode to suit, and ignores the window size.

It's probably still a good idea to resize the window anyway, just to keep fullscreen and windowed mode code the same.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!