feat: pause Metal renderer and graph when app is in background
This commit is contained in:
1 parent
a2c4d440db
commit
c8f61b0b87
5 files changed
+98
-19
No files matched your search
@@ -128,6 +128,12 @@
|
||||
- (void)drawInMTKView:(MTKView *)view
|
||||
{
|
||||
#if !defined(IMGUI_DISABLE)
|
||||
// Don't render if app is in background to avoid GPU submission errors
|
||||
// Allow rendering when inactive (control center, notifications)
|
||||
if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground) {
|
||||
return;
|
||||
}
|
||||
|
||||
ImGuiIO &io = ImGui::GetIO();
|
||||
io.DisplaySize.x = view.bounds.size.width;
|
||||
io.DisplaySize.y = view.bounds.size.height;
|
||||
|
||||
Reference in new issue
Block a user