From 0613343c5d8a1f62ed3cc78959ae953a52f08b2b Mon Sep 17 00:00:00 2001 From: VanjaRo Date: Thu, 8 Aug 2024 21:51:03 +0300 Subject: [PATCH] fix: fixed examples configs to lower the CPU consumption on MacOS --- examples/blobs.rs | 2 ++ examples/instancing.rs | 2 ++ examples/offscreen.rs | 2 ++ examples/quad.rs | 2 ++ examples/triangle.rs | 2 ++ examples/triangle_color4b.rs | 3 +++ 6 files changed, 13 insertions(+) diff --git a/examples/blobs.rs b/examples/blobs.rs index f29ea4e6..3d8c9092 100644 --- a/examples/blobs.rs +++ b/examples/blobs.rs @@ -158,6 +158,8 @@ fn main() { } else { conf::AppleGfxApi::OpenGl }; + // mitigating high CPU consumption + conf.platform.blocking_event_loop = true; miniquad::start(conf, move || Box::new(Stage::new())); } diff --git a/examples/instancing.rs b/examples/instancing.rs index 4084aad3..3662f546 100644 --- a/examples/instancing.rs +++ b/examples/instancing.rs @@ -179,6 +179,8 @@ fn main() { } else { conf::AppleGfxApi::OpenGl }; + // mitigating high CPU consumption + conf.platform.blocking_event_loop = true; miniquad::start(conf, move || Box::new(Stage::new())); } diff --git a/examples/offscreen.rs b/examples/offscreen.rs index f8c32957..25ba7bfa 100644 --- a/examples/offscreen.rs +++ b/examples/offscreen.rs @@ -221,6 +221,8 @@ fn main() { } else { conf::AppleGfxApi::OpenGl }; + // mitigating high CPU consumption + conf.platform.blocking_event_loop = true; miniquad::start(conf, move || Box::new(Stage::new())); } diff --git a/examples/quad.rs b/examples/quad.rs index dfb938b0..9c60101f 100644 --- a/examples/quad.rs +++ b/examples/quad.rs @@ -124,6 +124,8 @@ fn main() { conf::AppleGfxApi::OpenGl }; conf.platform.webgl_version = conf::WebGLVersion::WebGL2; + // mitigating high CPU consumption + conf.platform.blocking_event_loop = true; miniquad::start(conf, move || Box::new(Stage::new())); } diff --git a/examples/triangle.rs b/examples/triangle.rs index 383dbf48..fbffda11 100644 --- a/examples/triangle.rs +++ b/examples/triangle.rs @@ -97,6 +97,8 @@ fn main() { } else { conf::AppleGfxApi::OpenGl }; + // mitigating high CPU consumption + conf.platform.blocking_event_loop = true; miniquad::start(conf, move || Box::new(Stage::new())); } diff --git a/examples/triangle_color4b.rs b/examples/triangle_color4b.rs index e01a3c36..f06f9a54 100644 --- a/examples/triangle_color4b.rs +++ b/examples/triangle_color4b.rs @@ -100,6 +100,9 @@ fn main() { } else { conf::AppleGfxApi::OpenGl }; + // mitigating high CPU consumption + conf.platform.blocking_event_loop = true; + miniquad::start(conf, move || Box::new(Stage::new())); }