title: OpenGL GL_LINES endpoints not joining
body: <p><img src="https://i.stack.imgur.com/ooHbJ.jpg" alt="alt text">I'm having problems with the GL_LINES block... the lines in the sample below do not connect on the ends (although sometimes it randomly decides to connect a corner or two). Instead, the endpoints come within 1 pixel of one another (leaving a corner that is not fully squared; if that makes sense). It is a simple block to draw a solid 1-pixel rectangle.</p>
  
  <pre><code> glBegin(GL_LINES);
  
    glColor3b(cr, cg, cb);
  
    glVertex3i(pRect-&gt;left, pRect-&gt;top, 0);
    glVertex3i(pRect-&gt;right, pRect-&gt;top, 0);
  
    glVertex3i(pRect-&gt;right, pRect-&gt;top, 0);
    glVertex3i(pRect-&gt;right, pRect-&gt;bottom, 0);
  
    glVertex3i(pRect-&gt;right, pRect-&gt;bottom, 0);
    glVertex3i(pRect-&gt;left, pRect-&gt;bottom, 0);
  
    glVertex3i(pRect-&gt;left, pRect-&gt;bottom, 0);
    glVertex3i(pRect-&gt;left, pRect-&gt;top, 0);
  
   glEnd();
  </code></pre>
  
  <p>The sample below seems to correct the problem, giving me sharp, square corners; but I can't accept it because I don't know why it's acting this way...</p>
  
  <pre><code> glBegin(GL_LINES);
  
    glColor3b(cr, cg, cb);
  
    glVertex3i(pRect-&gt;left, pRect-&gt;top, 0);
    glVertex3i(pRect-&gt;right + 1, pRect-&gt;top, 0);
  
    glVertex3i(pRect-&gt;right, pRect-&gt;top, 0);
    glVertex3i(pRect-&gt;right, pRect-&gt;bottom + 1, 0);
  
    glVertex3i(pRect-&gt;right, pRect-&gt;bottom, 0);
    glVertex3i(pRect-&gt;left - 1, pRect-&gt;bottom, 0);
  
    glVertex3i(pRect-&gt;left, pRect-&gt;bottom, 0);
    glVertex3i(pRect-&gt;left, pRect-&gt;top - 1, 0);
  
   glEnd();
  </code></pre>
  
  <p>Any OpenGL programmers out there that can help, I would appreciate it :)</p>
  
  <p>The picture is a zoomed-in view of a screenshot. As you can see, the top left corner is not connected. The top right corner is. Not see are the bottom left and right, which are not connected.</p>
  
  <p>The viewport is setup to a 1 to 1 pixel per coordinate.</p>
  
  <pre><code>glDisable(GL_DEPTH_TEST);
  glDisable(GL_LIGHTING);
  glMatrixMode(GL_PROJECTION);
  glPushMatrix();
  glLoadIdentity();
  glOrtho(0, __nRendererWidth, __nRendererHeight, 0, -1, 100);
  glMatrixMode(GL_MODELVIEW);
  glPushMatrix();
  glLoadIdentity();
  glEnable (GL_TEXTURE_2D);
  </code></pre>