Jump to content
  • Advertisement
Sign in to follow this  
sofakng

How can I resolution independant 2D graphics in DirectX?

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

How can I resolution independant 2D graphics in DirectX? I'm using a DirectX wrapper for Delphi called Asphyre Extreme but it's basically using DirectX v7.0 (I'm pretty sure). However, if I upgrade to the latest version of Asphyre I believe it uses DirectX v9.0. It seems like when I'm in windowed mode the graphics are automatically scaled to whatever resolution I specified, but in full-screen mode they are not. For example, if my window size is 320x240 and if I specified a DirectX device resolution of 800x600, I can specify coodinates in 800x600 and they will be automatically mapped to my 320x240 window. However, if I'm using a full-screen resolution the coordinates are mapped 1-to-1. So how can I be resolution independant? Somebody suggested using "virtual" coordinates 0.0 to 1.0 and then multiply them by the real resolution but I'm not sure this is the best answer. Thanks for your help!

Share this post


Link to post
Share on other sites
Advertisement
whoever sugested the 0-1 "virtual" coordinates is correct except you dont multiply them your self you just put the scaling into the projection matrix, your not likly to find any better way to do it.

P.S. your "virtual" coordinates dont have to be 0-1 you can pick your "prefered" or "ideal" resolution and use that then scale everything from that to the correct resolution (using the projection matrix).

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!