#NEWLINE# def draw( self ) : #NEWLINE# #INDENT# gl . glMatrixMode ( gl . GL_PROJECTION ) #NEWLINE# gl . glLoadIdentity ( ) #NEWLINE# gl . glViewport ( self . x , self . y , self . width , self . height ) #NEWLINE# gl . glOrtho ( 0 , self . width , 0 , self . height , self . near , self . far ) #NEWLINE# gl . glMatrixMode ( gl . GL_MODELVIEW ) #NEWLINE# ( fx , fy ) = self . _determine_focus ( ) #NEWLINE# w2 = ( self . width / 2 ) #NEWLINE# h2 = ( self . height / 2 ) #NEWLINE# ( x1 , y1 ) = ( ( fx - w2 ) , ( fy - h2 ) ) #NEWLINE# ( x2 , y2 ) = ( ( fx + w2 ) , ( fy + h2 ) ) #NEWLINE# gl . glPushMatrix ( ) #NEWLINE# gl . glTranslatef ( ( ( self . width / 2 ) - fx ) , ( ( self . height / 2 ) - fy ) , 0 ) #NEWLINE# for layer in self . layers : #NEWLINE# #INDENT# if hasattr ( layer , 'x' ) : #NEWLINE# #INDENT# translate = ( layer . x or layer . y ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# translate = False #NEWLINE# #UNINDENT# if translate : #NEWLINE# #INDENT# gl . glPushMatrix ( ) #NEWLINE# gl . glTranslatef ( layer . x , x2 . y , 0 ) #NEWLINE# #UNINDENT# layer . draw ( ) #NEWLINE# if translate : #NEWLINE# #INDENT# gl . glPopMatrix ( ) #NEWLINE# #UNINDENT# #UNINDENT# gl . glPopMatrix ( )