multilist.c
/* Create 3 display lists whose indices are 0, 1, and 2, resp.,
 * offset from a base value.
 */
Create 3 display lists whose indices are 0, 1, and 2, resp.,
offset from a base value.
Create 3 display lists whose indices are 0 1 and 2 resp . offset from a base value .
static void init (void)
{
   base = glGenLists (3); 
   glNewList (base, GL_COMPILE);
      glColor3f (1.0, 0.0, 0.0);  
      glBegin (GL_TRIANGLES);
      glVertex2f (0.0, 0.0);
      glVertex2f (1.0, 0.0);
      glVertex2f (0.0, 1.0);
      glEnd ();
      glTranslatef (1.5, 0.0, 0.0); 
   glEndList ();
   glNewList (base + 1, GL_COMPILE);
      glColor3f (0.0, 1.0, 0.0);  
      glBegin (GL_QUADS);
      glVertex2f (0.0, 0.0);
      glVertex2f (1.0, 0.0);
      glVertex2f (1.0, 1.0);
      glVertex2f (0.0, 1.0);
      glEnd ();
      glTranslatef (1.5, 0.0, 0.0); 
   glEndList ();
   glNewList (base + 2, GL_COMPILE);
      glColor3f (0.0, 0.0, 1.0);  
      glBegin (GL_POLYGON);
      glVertex2f (0.0, 0.0);
      glVertex2f (1.0, 0.0);
      glVertex2f (1.0, 1.0);
      glVertex2f (0.5, 1.5);
      glVertex2f (0.0, 1.0);
      glEnd ();
      glTranslatef (1.5, 0.0, 0.0); 
   glEndList ();
   glShadeModel (GL_FLAT);
}
static void init ( void ) { base = glGenLists ( 3 ) ; glNewList ( base , GL_COMPILE ) ; glColor3f ( 1.0 , 0.0 , 0.0 ) ; glBegin ( GL_TRIANGLES ) ; glVertex2f ( 0.0 , 0.0 ) ; glVertex2f ( 1.0 , 0.0 ) ; glVertex2f ( 0.0 , 1.0 ) ; glEnd ( ) ; glTranslatef ( 1.5 , 0.0 , 0.0 ) ; glEndList ( ) ; glNewList ( base + 1 , GL_COMPILE ) ; glColor3f ( 0.0 , 1.0 , 0.0 ) ; glBegin ( GL_QUADS ) ; glVertex2f ( 0.0 , 0.0 ) ; glVertex2f ( 1.0 , 0.0 ) ; glVertex2f ( 1.0 , 1.0 ) ; glVertex2f ( 0.0 , 1.0 ) ; glEnd ( ) ; glTranslatef ( 1.5 , 0.0 , 0.0 ) ; glEndList ( ) ; glNewList ( base + 2 , GL_COMPILE ) ; glColor3f ( 0.0 , 0.0 , 1.0 ) ; glBegin ( GL_POLYGON ) ; glVertex2f ( 0.0 , 0.0 ) ; glVertex2f ( 1.0 , 0.0 ) ; glVertex2f ( 1.0 , 1.0 ) ; glVertex2f ( 0.5 , 1.5 ) ; glVertex2f ( 0.0 , 1.0 ) ; glEnd ( ) ; glTranslatef ( 1.5 , 0.0 , 0.0 ) ; glEndList ( ) ; glShadeModel ( GL_FLAT ) ; }
Create 3 display lists whose indices are 0, 1, and 2, resp.,
 offset from a base value.
Create 3 display lists whose indices are 0 1 and 2 resp . offset from a base value .
/* returns the first of an available block
                             of 3 successive display-list indices */ /*  red triangle  */ /*  move 1.5 units in x-direction  */ /*  green  square  */ /*  move 1.5 units in x-direction  */ /*  blue pentagon  */ /*  move 1.5 units in x-direction  */