Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: newbie GLOrtho2d question

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2001
    Location
    wrwrqwrqw
    Posts
    14

    newbie GLOrtho2d question

    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 ?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: newbie GLOrtho2d question

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •