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 3 of 3

Thread: OpenGL points and lines

Threaded View

  1. #1
    Newbie Newbie
    Join Date
    Jan 2013
    Posts
    2

    OpenGL points and lines

    Here is the version information of OpenGL I am using

    OpenGL version: 3.1.0 - Build 8.15.10.2559
    OpenGL vendor: Intel
    OpenGL renderer: Intel(R) HD Graphics Family

    The following code in my display callback is:
    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(1.0f, 1.0f, 1.0f);
    glBegin(GL_POINTS);
    for(int r = 1; r < 250; ++r)
    {
    glVertex2i(2, r);
    }
    glEnd();

    glColor3f(1.0f, 0.0f, 0.0f);
    glBegin(GL_LINES);
    glVertex2i(2, 1);
    glVertex2i(2, 249);
    glEnd();

    This code should draw one line on top of the other but it renders the red line to the left of the white line. Can anyone explain this? Thanks.
    Last edited by rapademic; 01-03-2013 at 09:06 AM.

Posting Permissions

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