from OpenGL.GL import *

class LitTexTri:
    def __init__(self, vertexes, normals, texcoords):
        self.vertexes = vertexes
        self.normals = normals
        self.texcoords = texcoords
        self.rendered = 0

    def render(self):
        '''This must be called in a GL_TRIANGLES context
        '''
        v1, v2, v3 = self.vertexes
        n1, n2, n3 = self.normals
        t1, t2, t3 = self.texcoords

        glTexCoord2d(*t1)
        glNormal3d(*n1)
        glVertex3d(*v1)

        glTexCoord2d(*t2)
        glNormal3d(*n2)
        glVertex3d(*v2)

        glTexCoord2d(*t3)
        glNormal3d(*n3)
        glVertex3d(*v3)
        self.rendered = 1
