Jump to content
  • Advertisement
Sign in to follow this  
levjs

Drawing Over the Whole Screen

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

Hi, Here's something that has been bothering me for a looong time. I am making a program that I want to be able to use in any screen dimension(1024x768, 1280x1024 etc.) The problem is, when I draw a square to cover the whole screen(say to put a background picture on), it may or may not cover the screen according to the screen resolution. For example, something that would cover the screen in 800x600 would not quite cover it in 1280x1024. What can I do to fix this? I'm drawing in projection mode, not orthographic. Thanks! Levi

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by levjs
...I'm drawing in projection mode, not orthographic...
I think you mean with a perspective projection matrix instead of an orthographic projection matrix.

Why not just use an orthographic projection when rendering the full-screen quad? Changing the projection matrix will be much faster than doing the math to calculate the screen extents. You can even just set the projection and modelview matrices to identity, then any vertices you pass to OpenGL will be in clip coordinates and if all of them have a w of 1.0 then this will be the same as normalized device coordinates. In this case the screen extents are simply (±1, ±1), so to draw a full-screen quad you simply render a quad from (-1,-1) to (1,1).

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!