#NEWLINE# def draw( self ) : #NEWLINE# #INDENT# ( x , y ) = director . get_window_size ( ) #NEWLINE# x = ( x // 2 ) #NEWLINE# y = ( y // 2 ) #NEWLINE# d = 100 #NEWLINE# if self . shader_program : #NEWLINE# #INDENT# self . shader_program . set_state ( self ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# glEnable ( GL_TEXTURE_2D ) #NEWLINE# glBindTexture ( GL_TEXTURE_2D , self . texture . id ) #NEWLINE# #UNINDENT# glPushMatrix ( ) #NEWLINE# self . transform ( ) #NEWLINE# glBegin ( GL_TRIANGLES ) #NEWLINE# glColor4ub ( 0 , 255 , 0 , 255 ) #NEWLINE# glTexCoord2f ( 1.0 , 1.0 ) #NEWLINE# glVertex2f ( ( x + d ) , ( y + d ) ) #NEWLINE# glColor4ub ( 255 , 255 , 255 , 255 ) #NEWLINE# glTexCoord2f ( 0.0 , 1.0 ) #NEWLINE# glVertex2f ( ( x - d ) , ( y + d ) ) #NEWLINE# glColor4ub ( 255 , 255 , 255 , 255 ) #NEWLINE# glTexCoord2f ( 1.0 , 0.0 ) #NEWLINE# glVertex2f ( ( x + d ) , ( y - d ) ) #NEWLINE# glColor4ub ( 255 , 255 , 255 , 255 ) #NEWLINE# glTexCoord2f ( 0.0 , 1.0 ) #NEWLINE# glVertex2f ( ( x - d ) , ( y + d ) ) #NEWLINE# glColor4ub ( 0 , 0 , 255 , 255 ) #NEWLINE# glTexCoord2f ( 0.0 , 0.0 ) #NEWLINE# glVertex2f ( ( x - d ) , ( y - d ) ) #NEWLINE# glColor4ub ( 255 , 255 , 255 , 255 ) #NEWLINE# glTexCoord2f ( 1.0 , 0.0 ) #NEWLINE# glVertex2f ( ( x + d ) , ( y - d ) ) #NEWLINE# glEnd ( ) #NEWLINE# glPopMatrix ( ) #NEWLINE# if self . shader_program : #NEWLINE# #INDENT# self . shader_program . unset_state ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# glBindTexture ( GL_TEXTURE_2D , 0 ) #NEWLINE# glDisable ( GL_TEXTURE_2D )