openGL different line widths

Submitted by techrev on Sun, 07/09/2017 - 09:59
Forums

works with our master program (eng simu)

void jijscene()
{
  GLfloat y;        // Storage for varying Y coordinate
  GLfloat fSizes[2];      // Line width range metrics
  GLfloat fCurrSize;      // Save current size

  glGetFloatv(GL_LINE_WIDTH_RANGE,fSizes);
  fCurrSize = fSizes[0];

  // Step up y axis 20 units at a time
  for(y = -90.0f; y < 90.0f; y += 20.0f)
    {
    glLineWidth(fCurrSize);
    glBegin(GL_LINES);
      glVertex2f(-80.0f, y);
      glVertex2f(80.0f, y);
    glEnd();

   fCurrSize += 1.0f;
    }


}