Change Screen Res During Execution

Started by
11 comments, last by Buckeye 15 years, 9 months ago
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.
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?

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

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.
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.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

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.
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?
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.
Thanks, thats what I was looking for. Rated you up but it didn't seem to change your score.
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.
Million-to-one chances occur nine times out of ten!
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.

This topic is closed to new replies.

Advertisement