egui/egui_web/src/painter.rs
triangle drawer 804722a1ba
Make egui_glow painter to work on web (#868)
Add WebGL1 and WebGL2 support to glow painter.
Add "glow" feature to egui_web to use the glow painter there.
Make winit an optional part of egui_glow
2021-11-03 19:17:07 +01:00

22 lines
566 B
Rust

use wasm_bindgen::prelude::JsValue;
pub trait Painter {
fn as_tex_allocator(&mut self) -> &mut dyn epi::TextureAllocator;
fn debug_info(&self) -> String;
/// id of the canvas html element containing the rendering
fn canvas_id(&self) -> &str;
fn upload_egui_texture(&mut self, texture: &egui::Texture);
fn clear(&mut self, clear_color: egui::Rgba);
fn paint_meshes(
&mut self,
clipped_meshes: Vec<egui::ClippedMesh>,
pixels_per_point: f32,
) -> Result<(), JsValue>;
fn name(&self) -> &'static str;
}