fn render_background(&mut self) {
        let background_color = self.core.sync(|core| core.background_color);

        // If there's a background colour, then the finalize step should draw it (the OpenGL renderer has issues blitting alpha blended multisampled textures, so this hides that the 'clear' step above doesn't work there)
        let render::Rgba8([br, bg, bb, ba]) = background_color;

        if ba > 0 {
            let background_color = [br, bg, bb, ba];

            self.pending_stack.extend(vec![
                render::RenderAction::DrawTriangles(self.background_vertex_buffer, 0..6),
                render::RenderAction::UseShader(render::ShaderType::Simple { erase_texture: None, clip_texture: None }),
                render::RenderAction::BlendMode(render::BlendMode::DestinationOver),
                render::RenderAction::SetTransform(render::Matrix::identity()),

                // Generate a full-screen quad
                render::RenderAction::CreateVertex2DBuffer(self.background_vertex_buffer, vec![
                    render::Vertex2D { pos: [-1.0, -1.0],   tex_coord: [0.0, 0.0], color: background_color },
                    render::Vertex2D { pos: [1.0, 1.0],     tex_coord: [0.0, 0.0], color: background_color },
                    render::Vertex2D { pos: [1.0, -1.0],    tex_coord: [0.0, 0.0], color: background_color },

                    render::Vertex2D { pos: [-1.0, -1.0],   tex_coord: [0.0, 0.0], color: background_color },
                    render::Vertex2D { pos: [1.0, 1.0],     tex_coord: [0.0, 0.0], color: background_color },
                    render::Vertex2D { pos: [-1.0, 1.0],    tex_coord: [0.0, 0.0], color: background_color },
                ])
            ]);
        }
    }
///
/// Adds the instructions required to render the background colour to the pending queue
///
Adds the instructions required to render the background colour to the pending queue
Adds the instructions required to render the background colour to the pending queue
fn render_background(&mut self) {
        let background_color = self.core.sync(|core| core.background_color);
        // If there's a background colour, then the finalize step should draw it (the OpenGL renderer has issues blitting alpha blended multisampled textures, so this hides that the 'clear' step above doesn't work there)
        let render::Rgba8([br, bg, bb, ba]) = background_color;
        if ba > 0 {
            let background_color = [br, bg, bb, ba];
            self.pending_stack.extend(vec![
                render::RenderAction::DrawTriangles(self.background_vertex_buffer, 0..6),
                render::RenderAction::UseShader(render::ShaderType::Simple { erase_texture: None, clip_texture: None }),
                render::RenderAction::BlendMode(render::BlendMode::DestinationOver),
                render::RenderAction::SetTransform(render::Matrix::identity()),
                // Generate a full-screen quad
                render::RenderAction::CreateVertex2DBuffer(self.background_vertex_buffer, vec![
                    render::Vertex2D { pos: [-1.0, -1.0],   tex_coord: [0.0, 0.0], color: background_color },
                    render::Vertex2D { pos: [1.0, 1.0],     tex_coord: [0.0, 0.0], color: background_color },
                    render::Vertex2D { pos: [1.0, -1.0],    tex_coord: [0.0, 0.0], color: background_color },
                    render::Vertex2D { pos: [-1.0, -1.0],   tex_coord: [0.0, 0.0], color: background_color },
                    render::Vertex2D { pos: [1.0, 1.0],     tex_coord: [0.0, 0.0], color: background_color },
                    render::Vertex2D { pos: [-1.0, 1.0],    tex_coord: [0.0, 0.0], color: background_color },
                ])
            ]);
        }
    }
fn render_background ( & mut self ) { let background_color = self . core . sync ( | core | core . background_color ) ; // If there's a background colour, then the finalize step should draw it (the OpenGL renderer has issues blitting alpha blended multisampled textures, so this hides that the 'clear' step above doesn't work there) let render :: Rgba8 ( [ br , bg , bb , ba ] ) = background_color ; if ba > 0 { let background_color = [ br , bg , bb , ba ] ; self . pending_stack . extend ( vec ! [ render RenderAction DrawTriangles ( self background_vertex_buffer 0 6 ) render RenderAction UseShader ( render ShaderType Simple { erase_texture None clip_texture None } ) render RenderAction BlendMode ( render BlendMode DestinationOver ) render RenderAction SetTransform ( render Matrix identity ( ) ) // Generate a full-screen quad render RenderAction CreateVertex2DBuffer ( self background_vertex_buffer vec [ render Vertex2D { pos [ 1.0 1.0 ] tex_coord [ 0.0 0.0 ] color background_color } render Vertex2D { pos [ 1.0 1.0 ] tex_coord [ 0.0 0.0 ] color background_color } render Vertex2D { pos [ 1.0 1.0 ] tex_coord [ 0.0 0.0 ] color background_color } render Vertex2D { pos [ 1.0 1.0 ] tex_coord [ 0.0 0.0 ] color background_color } render Vertex2D { pos [ 1.0 1.0 ] tex_coord [ 0.0 0.0 ] color background_color } render Vertex2D { pos [ 1.0 1.0 ] tex_coord [ 0.0 0.0 ] color background_color } ] ) ] ) ; } }
Adds the instructions required to render the background colour to the pending queue
Adds the instructions required to render the background colour to the pending queue
&mut self