View Full Version : Fixing size of shapes when window resizes

09-04-2003, 08:19 AM

I've got a program where I have a triangle that takes up half the screen. When I resize the window, the triangle also changes size. Can anyone tell me how to make sure the triangle stays the same size no matter what?


Andrea Rossini
09-05-2003, 12:03 AM
I assume you setup your projection matrix with:

void gluOrtho2D(
GLdouble left,
GLdouble right,
GLdouble bottom,
GLdouble top

I assume you are giving it always the same values.

You must pass your window's size instead:

gluOrtho2D(0, widht, height, 0);