cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

mksrksh
Adept II

OpenGL: glEdgeFlag not working properly under certain circumstances

Jump to solution

Hello Devgurus,

in some cases the call to glEdgeFlag with GL_FALSE as parameter seem to fail if used inside of display lists.

To reproduce the wrong behaviour just create the simplest glut example (console) application and set the following function for the display routine callback:

void display(void)

{

  static GLint list = 0;

  if (!list)

  {

  list = glGenLists(1);

  glNewList(list, GL_COMPILE);

  glPushMatrix();

  glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

  glBegin(GL_TRIANGLES);

  glEdgeFlag(GL_TRUE);

  glVertex3d(-100.0, -100.0, 0.0);

  glEdgeFlag(GL_FALSE);

  glVertex3d(100.0, -100.0, 0.0);

  glEdgeFlag(GL_TRUE);

  glVertex3d(-100.0, 100.0, 0.0);

  glEdgeFlag(GL_FALSE);

  glVertex3d(-100.0, 100.0, 0.0);

  glEdgeFlag(GL_TRUE);

  glVertex3d(100.0, -100.0, 0.0);

  glVertex3d(100.0, 100.0, 0.0);

  glEnd();

  glPopMatrix();

  glPushMatrix();

  glTranslated(-160, 0, 0);

  if (true) // set it to false to make glEdgeFlag to work properly

  {

  glBegin(GL_LINES);

  glVertex3d(0, 0, 0);

  glVertex3d(0, 50, 0);

  glEnd();

  }

  glPopMatrix();

  glEndList();

  }

  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

  glColor3f(1.0, 1.0, 1.0);

  glCallList(list);

  glutSwapBuffers();

}

What I would expect to see if I run the application is just an outline of a rectangle and a line, please find right.png attached. But on the AMD graphic adapters there is a diagonal line inside the rectangle, see wrong.png. This line should be suppressed by the call to glEdgeFlag in line 16 which does not work.

As a side note if you do not draw the last stand alone line (set if statement to false in line 32) or if you do not use display lists at all glEdgeFlag works fine and the diagonal line disappears.

Tested with current drivers on:

Windows 8.1 (64bit)

Windows 7 (64bit)

AMD Radeon R7 200 Series

AMD FirePro W2100

Thank You in advance and kind regards

0 Likes
1 Solution

Accepted Solutions
mksrksh
Adept II

Re: OpenGL: glEdgeFlag not working properly under certain circumstances

Jump to solution

The issue was fixed in the recent AMD drivers (Crimson 16.12.1 and RadeonPro 16.50).

Thanks a lot!

View solution in original post

0 Likes
2 Replies
dwitczak
Staff
Staff

Re: OpenGL: glEdgeFlag not working properly under certain circumstances

Jump to solution

Thanks for the report. I've passed it down to the driver team. Will get back to you as soon as I have more info to share.

0 Likes
mksrksh
Adept II

Re: OpenGL: glEdgeFlag not working properly under certain circumstances

Jump to solution

The issue was fixed in the recent AMD drivers (Crimson 16.12.1 and RadeonPro 16.50).

Thanks a lot!

0 Likes