PDA

View Full Version : newbie GLOrtho2d question



Raketman
09-02-2001, 10:29 PM
Hi, i wanna use a 2D screen with
::gluOrtho2D(-10.0f, 10.0f, -10.0f, 10.0f);
Now, when I draw a line like this :

glBegin(GL_LINE);
{
glVertex2f(-10, 0);
glVertex2f(10, 0);
}
glEnd();

initially the line is ok, but by rezising the screen, the line doesnt reach the right side of the client area ... How does this system work ?

Bob
09-03-2001, 12:56 AM
If you resize the window, you must also resize OpenGL's viewport. You do that with glViewport. glViewport tells OpenGL to what parts of the window you want to draw to.