1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 05:10:03 -04:00

Improve OpenGL error detection and reporting in egui_glow

May help to diagnose https://github.com/emilk/egui/issues/1087
This commit is contained in:
Emil Ernerfeldt
2022-01-09 23:04:00 +01:00
parent 611eaa52e8
commit 650057dd4a
5 changed files with 43 additions and 36 deletions

View File

@@ -132,7 +132,7 @@ pub fn init_glow_context_from_canvas(canvas: &HtmlCanvasElement) -> glow::Contex
.expect("Failed to query about WebGL1 context");
if let Some(gl1) = gl1 {
crate::console_log("WebGL2 not available - falling back to WebGL2");
crate::console_log("WebGL2 not available - falling back to WebGL1");
let gl1_ctx = gl1.dyn_into::<web_sys::WebGlRenderingContext>().unwrap();
glow::Context::from_webgl1_context(gl1_ctx)
} else {