mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
egui_web: always use the glow painter, and remove the old WebGL code. (#1356)
* egui_web: always use the glow painter, and remove the old WebGL code. * Clean up the WebPainter trait * Clarify WebGL1 warning text in color test The glow painter became standard in egui 0.17, and I've heard no complaints! So let's simplify and go all in on glow. Part of https://github.com/emilk/egui/issues/1198
This commit is contained in:
@@ -32,11 +32,19 @@ impl WrappedGlowPainter {
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::Painter for WrappedGlowPainter {
|
||||
impl crate::WebPainter for WrappedGlowPainter {
|
||||
fn name(&self) -> &'static str {
|
||||
"egui_web"
|
||||
}
|
||||
|
||||
fn max_texture_side(&self) -> usize {
|
||||
self.painter.max_texture_side()
|
||||
}
|
||||
|
||||
fn canvas_id(&self) -> &str {
|
||||
&self.canvas_id
|
||||
}
|
||||
|
||||
fn set_texture(&mut self, tex_id: egui::TextureId, delta: &egui::epaint::ImageDelta) {
|
||||
self.painter.set_texture(&self.glow_ctx, tex_id, delta);
|
||||
}
|
||||
@@ -45,18 +53,6 @@ impl crate::Painter for WrappedGlowPainter {
|
||||
self.painter.free_texture(&self.glow_ctx, tex_id);
|
||||
}
|
||||
|
||||
fn debug_info(&self) -> String {
|
||||
format!(
|
||||
"Stored canvas size: {} x {}",
|
||||
self.canvas.width(),
|
||||
self.canvas.height(),
|
||||
)
|
||||
}
|
||||
|
||||
fn canvas_id(&self) -> &str {
|
||||
&self.canvas_id
|
||||
}
|
||||
|
||||
fn clear(&mut self, clear_color: Rgba) {
|
||||
let canvas_dimension = [self.canvas.width(), self.canvas.height()];
|
||||
egui_glow::painter::clear(&self.glow_ctx, canvas_dimension, clear_color)
|
||||
@@ -76,10 +72,6 @@ impl crate::Painter for WrappedGlowPainter {
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn name(&self) -> &'static str {
|
||||
"egui_web (glow)"
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns glow context and shader prefix.
|
||||
|
||||
Reference in New Issue
Block a user