The concept is the same.
Assuming we’re using power-of-two textures, here’s how you’d render a rectangular sprite using 2 triangles:
//first triangle...
glTexCoord2f(0, 0); //top left
glVertex2f(0, 0);
glTexCoord2f(1f, 0); //top right
glVertex2f(width, 0);
glTexCoord2f(0, 1f); //bottom left
glVertex2f(0, height);
//second triangle...
glTexCoord2f(1f, 0); //top right
glVertex2f(width, 0);
glTexCoord2f(1f, 1f); //bottom right
glVertex2f(width, height);
glTexCoord2f(0f, 1f); //bottom left
glVertex2f(0, height);
Or do you mean tiling a texture onto an arbitrary triangle/polygon? For each vert you could calculate it like so:
//x, y -> the vertex location
//min/max x/y -> the min/max locations of your polygon/triangle
//scale -> how much to scale the texture; i.e. for tiling with GL_REPEAT
float u = (x - minX) / (maxX - minX);
float v = (y - minY) / (maxY - minY);
glTexCoord2f( u * scale, v * scale );
Using VBOs/vertex arrays/etc. you would use glTexCoordPointer. If you’re doing an all shader approach (OpenGL 3+) then you would use glVertexAttribPointer.