Listing 2: Creating a texture-mapped triangle
void CContoursDoc::CreateTriangleList(UINT nList) { ::glNewList(nList, GL_COMPILE); ::glNormal3f(0.0f, 0.0f, 1.0f); ::glBegin(GL_TRIANGLES); ::glTexCoord1f(0.1f); ::glVertex3d(-1, -1, 0); ::glTexCoord1f(0.7f); ::glVertex3d(-1, 1, 0); ::glTexCoord1f(1.0f); ::glVertex3d( 1, 0.8, 0); ::glEnd(); ::glEndList(); }