Here is the preceding IRIS GL code translated to OpenGL:
glNewList(10, GL_COMPILE); // List #10.
glColor3f(1, 0, 0);
glRecti(164, 33, 364, 600);
glEndList();
glNewList(20, GL_COMPILE); //List #20.
glColor3f(1, 1, 0); // Set color to YELLOW.
glPolygonMode(GL_BOTH, GL_LINE); // Unfilled mode.
glBegin(GL_POLYGON); // Use polygon to approximate a circle.
for(i=0; i<100; i++) {
cosine = 25 * cos(i * 2 * PI/100.0);
sine = 25 * sin(i * 2 * PI/100.0);
glVertex2f(cosine, sine);
}
glEnd();
glBegin(GL_QUADS);
glColorf(0, 1, 1); // Set color ro CYAN.
glVertex2i(100, 100);
glVertex2i(100, 200);
glVertex2i(200, 200);
glVertex2i(100, 200);
glEnd();
glEndList();
glNewList(30, GL_COMPILE); // List #30.
glCallList(10);
glColorf(1, 1, 1); // Set color to WHITE.
glRecti(400, 100, 500, 300);
glCallList(20);
glEndList();
// Execute the display lists.
glCallList(30);