Function webrender::renderer::init::create_webrender_instance

source ·
pub fn create_webrender_instance(
    gl: Rc<dyn Gl>,
    notifier: Box<dyn RenderNotifier>,
    options: WebRenderOptions,
    shaders: Option<&SharedShaders>,
) -> Result<(Renderer, RenderApiSender), RendererError>
Expand description

Initializes WebRender and creates a Renderer and RenderApiSender.

§Examples

Initializes a Renderer with some reasonable values. For more information see WebRenderOptions.

let opts = webrender::WebRenderOptions {
   device_pixel_ratio: 1.0,
   resource_override_path: None,
   enable_aa: false,
};
let (renderer, sender) = Renderer::new(opts);