I am trying to display primitives in normal fill mode and then as a wired frame.
Visualization Code:
glClear(GL_COLOR_BUFFER_BIT); glClearColor(0.9f, 0.9f, 0.9f, 1); // reset matrix glLoadIdentity(); // fill display list glColor3c(150, 255, 255); glCallList(lDList); // wireframe display list glColor3f(0, 0, 0); glLineWidth(10); glPolygonMode(GL_FRONT_AND_BACK, GL_LINES); glCallList(lDList); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
Display list creation code:
lDList = glGenLists(1); glNewList(lDList, GL_COMPILE); glBegin(GL_QUADS); glVertex3i(-1, -1, 0); glVertex3i(1, -1, 0); glVertex3i(1, -1, -25); glVertex3i(-1, -1, -25); glEnd(); glEndList();
glColor3c Macro:
#define glColor3c(r, g, b) glColor3f(r / 255, g / 255, b / 255)
I expect to get a bluish color plane drawn with a black frame around it, but all that happens is that the second time I present a display list, it just fills and draws the whole thing, overwriting the pixels for another primitive. I end up with the plane that I want to draw, but its just black (the color that I specified for the string "version").
Any other information that may be helpful is that I use SDL on Windows 7 with MSVC ++ 2010. I don't call glEnable, so I donβt have any weird settings that could ruin or possibly solve the problem . My only OpenGL installation code sets up the forecast matrix and model matrix, and then creates a display list.
Obviously, my question is: why the second time I draw a display list, does it populate the primitive instead of creating lines? How to fix it?