pub fn send_vertex_buffers(&mut self, layer_handle: LayerHandle) -> Vec<render::RenderAction> {
        use self::RenderEntity::*;

        let mut send_vertex_buffers = vec![];
        let mut layer               = self.layer(layer_handle);

        for render_idx in 0..layer.render_order.len() {
            match &layer.render_order[render_idx] {
                VertexBuffer(_buffers, _)                   => { 
                    send_vertex_buffers.extend(self.send_layer_vertex_buffer(layer_handle, render_idx)); 
                    layer = self.layer(layer_handle);
                },

                RenderSprite(sprite_id, _sprite_transform)  => { 
                    let sprite_id           = *sprite_id;
                    let sprite_layer_handle = self.sprites.get(&sprite_id).cloned();

                    if let Some(sprite_layer_handle) = sprite_layer_handle {
                        send_vertex_buffers.extend(self.send_vertex_buffers(sprite_layer_handle));
                    }

                    layer = self.layer(layer_handle);
                },

                _                                           => { }
            }
        }

        send_vertex_buffers
    }
///
/// Returns the render actions needed to prepare the render buffers for the specified layer (and updates the layer
/// so that the buffers are not sent again)
///
Returns the render actions needed to prepare the render buffers for the specified layer (and updates the layer
so that the buffers are not sent again)
Returns the render actions needed to prepare the render buffers for the specified layer ( and updates the layer so that the buffers are not sent again )
pub fn send_vertex_buffers(&mut self, layer_handle: LayerHandle) -> Vec<render::RenderAction> {
        use self::RenderEntity::*;
        let mut send_vertex_buffers = vec![];
        let mut layer               = self.layer(layer_handle);
        for render_idx in 0..layer.render_order.len() {
            match &layer.render_order[render_idx] {
                VertexBuffer(_buffers, _)                   => { 
                    send_vertex_buffers.extend(self.send_layer_vertex_buffer(layer_handle, render_idx)); 
                    layer = self.layer(layer_handle);
                },
                RenderSprite(sprite_id, _sprite_transform)  => { 
                    let sprite_id           = *sprite_id;
                    let sprite_layer_handle = self.sprites.get(&sprite_id).cloned();
                    if let Some(sprite_layer_handle) = sprite_layer_handle {
                        send_vertex_buffers.extend(self.send_vertex_buffers(sprite_layer_handle));
                    }
                    layer = self.layer(layer_handle);
                },
                _                                           => { }
            }
        }
        send_vertex_buffers
    }
pub fn send_vertex_buffers ( & mut self , layer_handle : LayerHandle ) -> Vec < render :: RenderAction > { use self :: RenderEntity :: * ; let mut send_vertex_buffers = vec ! [ ] ; let mut layer = self . layer ( layer_handle ) ; for render_idx in 0 .. layer . render_order . len ( ) { match & layer . render_order [ render_idx ] { VertexBuffer ( _buffers , _ ) => { send_vertex_buffers . extend ( self . send_layer_vertex_buffer ( layer_handle , render_idx ) ) ; layer = self . layer ( layer_handle ) ; } , RenderSprite ( sprite_id , _sprite_transform ) => { let sprite_id = * sprite_id ; let sprite_layer_handle = self . sprites . get ( & sprite_id ) . cloned ( ) ; if let Some ( sprite_layer_handle ) = sprite_layer_handle { send_vertex_buffers . extend ( self . send_vertex_buffers ( sprite_layer_handle ) ) ; } layer = self . layer ( layer_handle ) ; } , _ => { } } } send_vertex_buffers }
Returns the render actions needed to prepare the render buffers for the specified layer (and updates the layer
so that the buffers are not sent again)
Returns the render actions needed to prepare the render buffers for the specified layer ( and updates the layer so that the buffers are not sent again )
&mut self
layer_handle
LayerHandle