SIMPLE ILLUSTRATION OF TEXTURES

[Manual, ch.9]
  1. SETTING UP THE TEXTURE MAP
    glTexImage2D(  
          GL_TEXTURE_2D, // This argument is required
          0, // level
          3, // number of components (RGB here)
          width, // width of texture map
          height, // height of texture map
          0, // no border
          GL_RGB, // format of texture map
          GL_UNSIGNED_BYTE, // number type
          teximage); // pointer to actual map
  2. CALLING THE TEXTURE MAP -- DISPLAY FUNCTION
    void display( void )
    {
        glBegin( GL_QUADS );
        glTexCoord2i(0, 0); glVertex3i(0, 0, 0);
        glTexCoord2i(0, 1); glVertex3i(0, 10, 0);
        glTexCoord2i(1, 1); glVertex3i(100, 10, 0);
        glTexCoord2i(1, 0); glVertex3i(100, 10, 0);
        glEnd( );
        glFlush( );
    }
  3. SETTING UP TEXTURE MAP PARAMETERS