'Configure OpenGL to draw in 2d.'

def set_2d(self):

    (width, height) = self.get_size()
    glDisable(GL_DEPTH_TEST)
    glViewport(0, 0, width, height)
    glMatrixMode(GL_PROJECTION)
    glLoadIdentity()
    glOrtho(0, width, 0, height, (-1), 1)
    glMatrixMode(GL_MODELVIEW)
    glLoadIdentity()
