title: Drawing Bresenham’s Line- Algorithm in all quadrants
body: <p>I am newbie for OpenGL. I am practicing the exercises from my textbook but I could not get the outputs which is should be in Bresenham's Line Algorithm in all quadrants. </p>
  
  <p>Here's the coding:</p>
  
  <pre><code>#include &lt;Windows.h&gt;
  #include &lt;GL/glut.h&gt;
  void init(void) {
     glClearColor(0.0, 0.0, 0.0, 0.0);
     glShadeModel(GL_FLAT);
  }
  void BresnCir(void) {
     int delta, deltadash;
     glClear(GL_COLOR_BUFFER_BIT);
     glPointSize(3.0);
     int r = 150;
     int x = 0;
     int y = r;
     int D = 2 * (1 - r);
     glBegin(GL_POINTS);
     do {
        glVertex2i(x, y);
        if (D &lt; 0) {
           delta = 2 * D + 2 * y - 1;
           if (delta &lt;= 0) {
              x++;
              Right(x);
           } else {
              x++;
              y--;
              Diagonal(x, y);
           }
           glVertex2i(x, y);
        } else {
           deltadash = 2 * D - 2 * x - 1;
           if (deltadash &lt;= 0) {
              x++;
              y--;
              Diagonal(x, y);
           } else {
              y--;
              Down(y);
           }
           glVertex2i(x, y);
        }
        if (D == 0) {
           x++;
           y--;
           Diagonal(x, y);
           glVertex2i(x, y);
        }
     } while (y &gt; 0);
     glEnd();
     glFlush();
  }
  int main(int argc, char** argv) {
     glutInit(&amp;argc, argv);
     glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
     glutInitWindowSize(400, 150);
     glutInitWindowPosition(100, 100);
     glutCreateWindow(argv[0]);
     init();
     glutDisplayFunc(BresnCir);
     glutMainLoop();
     return 0;
  }
  </code></pre>
  
  <p>But, it keep comes out with errors C3861.</p>