Jump to content
  • Advertisement
Sign in to follow this  
Deliverance

Resolution independent GUI

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

First of all, I'm using opengl. How do I create a GUI system that will be resolution independent, that is by scaling, display the same on any resolution. I tried to solve the problem in the following mode: draw the GUI in world space(this definitely works but because of the texture filtering the quality of the output is not that high), and the second method draw the guy in screen space using glDrawPixels. The quality this time is way bigger than the quality obtained from the first method. But now, there is no stretching and scaling of the pixels and thus they don't align with the background. What should I do?

Share this post


Link to post
Share on other sites
Advertisement
This is how I approached it:

Draw your game.
Switch to Ortho and draw your 2d GUI.
Use a height based metric to properly size your controls and such.

Now, for images and that I made sure everything was oversized. Downscaling with LINEAR looks ok and you can use mipmaps to make it even cleaner. Fonts I just built at the proper size for the specific metric. This seems a clean and effective way to make the GUI resolution independent.

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!