title: Draw a graph in opengl
body: <p>I want to create a graph (2d graph) with my code,
  How can I make a simple 2d graph in opengl?
  I'm new in opengl, so maybe you can explain me how is the code works, please.
  by the way here is my code : </p>
  
  <pre><code>    #include &lt;iostream&gt;
  using namespace std;
  
  int main ()
  {
        double dt = 0.10;    //(it is constant)
        double t = 0.00;
  
        double dx = 0.10;    //(it is constant)
        double x = 0.00;
  
        double ddy = 1.00;   //(it is constant)
        double dy = 0.00;
        double y = 1.00;
  
        cout&lt;&lt;"t   = "&lt;&lt;t&lt;&lt;endl;
        cout&lt;&lt;"dx  = "&lt;&lt;dx&lt;&lt;endl;
        cout&lt;&lt;"x   = "&lt;&lt;x&lt;&lt;endl;
        cout&lt;&lt;"dy  = "&lt;&lt;dy&lt;&lt;endl;
        cout&lt;&lt;"y   = "&lt;&lt;y&lt;&lt;endl;
        cout&lt;&lt;endl;
  
        while(t&lt;=5) 
        {
                    x = x + dx*dt;
                    dy = dy - ddy * dt * dt;
                    y = y + dy * dt;
  
                    if (y&lt;=-1)
                    {
                               y = -y;
                               dy = -dy * 0.70;
                    }
        t  = t + dt;
  
        cout&lt;&lt;"t   = "&lt;&lt;t&lt;&lt;endl;
        cout&lt;&lt;"dx  = "&lt;&lt;dx&lt;&lt;endl;
        cout&lt;&lt;"x   = "&lt;&lt;x&lt;&lt;endl;
        cout&lt;&lt;"dy  = "&lt;&lt;dy&lt;&lt;endl;
        cout&lt;&lt;"y   = "&lt;&lt;y&lt;&lt;endl;
        cout&lt;&lt;endl;
  
        }
        system("pause");
  }
  </code></pre>