(self, renderer, visual)
Initialize the visual renderer, create the slicer, initialize
        all variables and the shaders.
Initialize the visual renderer, create the slicer, initialize
        all variables and the shaders.
Initialize the visual renderer create the slicer initialize all variables and the shaders .
def __init__(self, renderer, visual):
        """Initialize the visual renderer, create the slicer, initialize
        all variables and the shaders."""
        # register the master renderer (to access to other visual renderers)
        # and register the scene dictionary
        self.renderer = renderer
        self.scene = renderer.scene
        # register the visual dictionary
        self.visual = visual
        self.framebuffer = visual.get('framebuffer', None)
        # self.beforeclear = visual.get('beforeclear', None)
        # options
        self.options = visual.get('options', {})
        # hold all data changes until the next rendering pass happens
        self.data_updating = {}
        self.textures_to_copy = []
        # set the primitive type from its name
        self.set_primitive_type(self.visual['primitive_type'])
        # indexed mode? set in initialize_variables
        self.use_index = None
        # whether to use slicing? always True except when indexing should not
        # be used, but slicing neither
        self.use_slice = True
        # self.previous_size = None
        # set the slicer
        self.slicer = Slicer()
        # used when slicing needs to be deactivated (like for indexed arrays)
        self.noslicer = Slicer()
        # get size and bounds
        size = self.visual['size']
        bounds = np.array(self.visual.get('bounds', [0, size]), np.int32)
        # self.update_size(size, bounds)
        self.slicer.set_size(size)
        self.slicer.set_bounds(bounds)
        self.noslicer.set_size(size, doslice=False)
        self.noslicer.set_bounds(bounds)
        # compile and link the shaders
        self.shader_manager = ShaderManager(self.visual['vertex_shader'],
                                            self.visual['fragment_shader'])
                                            
        # DEBUG
        # log_info(self.shader_manager.vertex_shader)
        # log_info(self.shader_manager.fragment_shader)
                                            
        # initialize all variables
        # self.initialize_normalizers()
        self.initialize_variables()
        self.initialize_fbocopy()
        self.load_variables()
def __init__ ( self , renderer , visual ) : # register the master renderer (to access to other visual renderers) # and register the scene dictionary self . renderer = renderer self . scene = renderer . scene # register the visual dictionary self . visual = visual self . framebuffer = visual . get ( 'framebuffer' , None ) # self.beforeclear = visual.get('beforeclear', None) # options self . options = visual . get ( 'options' , { } ) # hold all data changes until the next rendering pass happens self . data_updating = { } self . textures_to_copy = [ ] # set the primitive type from its name self . set_primitive_type ( self . visual [ 'primitive_type' ] ) # indexed mode? set in initialize_variables self . use_index = None # whether to use slicing? always True except when indexing should not # be used, but slicing neither self . use_slice = True # self.previous_size = None # set the slicer self . slicer = Slicer ( ) # used when slicing needs to be deactivated (like for indexed arrays) self . noslicer = Slicer ( ) # get size and bounds size = self . visual [ 'size' ] bounds = np . array ( self . visual . get ( 'bounds' , [ 0 , size ] ) , np . int32 ) # self.update_size(size, bounds) self . slicer . set_size ( size ) self . slicer . set_bounds ( bounds ) self . noslicer . set_size ( size , doslice = False ) self . noslicer . set_bounds ( bounds ) # compile and link the shaders self . shader_manager = ShaderManager ( self . visual [ 'vertex_shader' ] , self . visual [ 'fragment_shader' ] ) # DEBUG # log_info(self.shader_manager.vertex_shader) # log_info(self.shader_manager.fragment_shader) # initialize all variables # self.initialize_normalizers() self . initialize_variables ( ) self . initialize_fbocopy ( ) self . load_variables ( )