OpenGL coordinates question

Posted by Chonch on Stack Overflow See other posts from Stack Overflow or by Chonch
Published on 2010-03-25T09:40:19Z Indexed on 2010/03/25 9:43 UTC
Read the original article Hit count: 428

Filed under:
|

Hey,

I have a simple OpenGL drawing. When the user changes the window's size, I want the drawing to maintain it's aspect ration. I accomplished that by setting the glViewport to the maximum rectangle with the appropriate aspect ration whenever the reshape method is called.

My problem is that I want to draw a square that will always remain in the top right corner of the window, no matter what the size or shape of the window is. Right now, that square moves around the screen whenever the window is reshaped.

Can anyone please explain how to do this?

Thank you,

© Stack Overflow or respective owner

Related posts about opengl

Related posts about coordinates