Sign in to follow this  

Maintain aspect ratio of 3D scene in Windowed Application?

This topic is 4810 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 have a 3D scene panel in a window (DX9+Win32, no MFC), whenever the size of the window (and the panel) is changed, the 3D scene is distorted accordingly. How do I maintain the scale ratio of the objects in the scene while the window can still be resized?

Share this post


Link to post
Share on other sites
When you change the size of the window that the direct 3d device is hooked up to (or one of the surfaces in the swap chain, etc.) direct 3d has to stretch the image on the old back buffer size to be displayed in the new window size. It is recommended that you change the size of the back buffer to match the new window size through a call to Reset.

Magius

Share this post


Link to post
Share on other sites
You could also intercept the WM_GETMINMAXINFO message sent to the window, and make sure that when for instance the width increases, the height increases accordingly (maintaining the aspect ratio).

Share this post


Link to post
Share on other sites

This topic is 4810 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this