(self)
Bind all textures of the visual.
        This method is used during rendering.
Bind all textures of the visual.
        This method is used during rendering.
Bind all textures of the visual . This method is used during rendering .
def bind_textures(self):
        """Bind all textures of the visual.
        This method is used during rendering."""
        
        textures = self.get_variables('texture')
        for i, variable in enumerate(textures):
            buffer = variable.get('buffer', None)
            if buffer is not None:
                
                # HACK: we update the sampler values here
                if self.update_samplers and not isinstance(variable['data'], RefVar):
                    Uniform.load_scalar(variable['location'], i)
                
                # NEW
                gl.glActiveTexture(getattr(gl, 'GL_TEXTURE%d' % i))
                
                Texture.bind(buffer, variable['ndim'])
            else:
                log_debug("Texture '%s' was not properly initialized." % \
                         variable['name'])
        # deactivate all textures if there are not textures
        if not textures:
            Texture.bind(0, 1)
            Texture.bind(0, 2)
        
        # no need to update the samplers after the first execution of this 
        # method
        self.update_samplers = False
def bind_textures ( self ) : textures = self . get_variables ( 'texture' ) for i , variable in enumerate ( textures ) : buffer = variable . get ( 'buffer' , None ) if buffer is not None : # HACK: we update the sampler values here if self . update_samplers and not isinstance ( variable [ 'data' ] , RefVar ) : Uniform . load_scalar ( variable [ 'location' ] , i ) # NEW gl . glActiveTexture ( getattr ( gl , 'GL_TEXTURE%d' % i ) ) Texture . bind ( buffer , variable [ 'ndim' ] ) else : log_debug ( "Texture '%s' was not properly initialized." % variable [ 'name' ] ) # deactivate all textures if there are not textures if not textures : Texture . bind ( 0 , 1 ) Texture . bind ( 0 , 2 ) # no need to update the samplers after the first execution of this  # method self . update_samplers = False