From a991c83d43631d8bb5e95f92d541c3c733a46089 Mon Sep 17 00:00:00 2001 From: InnocentusLime Date: Sat, 21 Sep 2024 16:43:31 +0300 Subject: [PATCH] Reset gl on update end --- src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index f9cfb25f..e0570318 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -856,7 +856,12 @@ impl Window { miniquad::start(miniquad_conf, move || { thread_assert::set_thread_id(); unsafe { - MAIN_FUTURE = Some(Box::pin(future)); + MAIN_FUTURE = Some(Box::pin(async { + future.await; + if let Some(ctx) = CONTEXT.as_mut() { + ctx.gl.reset(); + } + })); } let mut context = Context::new(); context.update_on = update_on.unwrap_or_default();