#NEWLINE# def attach( self , mipmap_level = 0 ) : #NEWLINE# #INDENT# if ( self . frame_buffer == 0 ) : #NEWLINE# #INDENT# raise Failed ( 'not initialised' ) #NEWLINE# #UNINDENT# self . bind ( ) #NEWLINE# R = zip ( self . colour , range ( GL_COLOR_ATTACHMENT0_EXT , ( GL_COLOR_ATTACHMENT0_EXT + len ( self . colour ) ) ) ) #NEWLINE# R . extend ( ( ( self . depth , GL_DEPTH_ATTACHMENT_EXT ) , ( self . stencil , GL_STENCIL_ATTACHMENT_EXT ) ) ) #NEWLINE# for ( surf_info , attachment ) in R : #NEWLINE# #INDENT# if ( surf_info is None ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ( surf , tgt ) = surf_info #NEWLINE# if ( mipmap_level . gl_id == 0 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if surf . is_texture : #NEWLINE# #INDENT# ( ( print >> sys . stderr ) , ( 'ATTACH: T:%d' % ( surf . gl_id , ) ) ) #NEWLINE# glFramebufferTexture2DEXT ( GL_FRAMEBUFFER_EXT , attachment , tgt , surf . gl_id , mipmap_level ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( ( print >> sys . stderr ) , ( 'ATTACH: R:%d' % ( surf . gl_id , ) ) ) #NEWLINE# glFramebufferRenderbufferEXT ( GL_FRAMEBUFFER_EXT , attachment , tgt , surf . gl_id ) #NEWLINE# #UNINDENT# #UNINDENT# status = glCheckFramebufferStatusEXT ( GL_FRAMEBUFFER_EXT ) #NEWLINE# if ( status != GL_FRAMEBUFFER_COMPLETE_EXT ) : #NEWLINE# #INDENT# raise Failed ( ( 'attach failed: ' + hex ( status ) ) )