Open VladasZ opened 1 month ago
src/platform_impl/ios/app_state.rs -> new function in EventLoopWaker impl block
when i changed interval time param that repeated too often, cpu usage down to zero percent but i dont know the function and side effect
test code is same your test device is my real iPhone 15 pro max iOS 17.6 test winit version is 0.30.0
@lsy969999 Sorry if this is a bit off topic, but is your application open source or do you know of a minimal iOS winit example? I've tried setting it up in the obvious way, and have no trouble getting it to work on desktop, but when my application starts up I'm not receiving any touch events.
@PWhiddy bevy repo uses winit, https://github.com/bevyengine/bevy/tree/main/examples test ios example
Thanks. I have built the bevy iOS example and it works fine for me, but the bevy codebase is complicated enough that it seemed like non-trivial work to extract that sample to a standalone minimal example. Are there any projects that use winit on iOS besides bevy?
Sorry, I learned about winit through Bevy, so I don't know about other examples using winit... Maybe tauri, egui, etc. use winit?
I have been using egui though I'm not sure if its meant to support iOS out of the box. Currently investigating this repo which uses a forked egui: https://github.com/lucasmerlin/egui-apple-example
Indeed the problem here seems to be our CFRunLoopTimer
, I think it gets triggered as-if you were using ControlFlow::Poll
. Will assign myself and fix the issue before v0.31
Description
I noticed that my iPhone gets really hot when I run my projects. While trying to debug this issue I stripped all my code and only
winit
code remained but the phone was still hot.I see that Xcode shows constant CPU load:
The same project has 0 CPU load on Android:
On Windows:
On Linux:
And on macOS:
What may cause the issue?
Minimal example to reproduce:
Rust code:
main.m in Xcode project:
Device and iOS version
iPhone 13 Pro running iOS 17.5.1, iPhone 5s running iOS 12.5.7, iPhone 15 Simulator running iOS 17.4
Winit version
0.30.1