Jump to content
  • Advertisement
Sign in to follow this  
Graham

Aspect ratio changing when window size changes

This topic is 4903 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 running my program in windowed mode resizing the window will cause the objects to be drawn with incorrect aspect ratios. I made a fix by recalculating the projection matrix evertime i get the WM_SIZE message. This seems to work fine, but is there a better solution? Also I am using D3DXFont and eventhough Im recalculating the projection matrix it still gets drawn incorrectly. I have tried redoing D3DXCreateFont() everytime I detect a size change but it doesnt help.

Share this post


Link to post
Share on other sites
Advertisement
If you don't change the viewport size when the window size changes, you don't have to change the projection matrix. Otherwise, you have to change the projection matrix whenever the aspect ratio of the viewport changes.

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!