diff --git a/backends/imgui_impl_metal.mm b/backends/imgui_impl_metal.mm index b89797647..881e62178 100644 --- a/backends/imgui_impl_metal.mm +++ b/backends/imgui_impl_metal.mm @@ -517,7 +517,7 @@ static void ImGui_ImplMetal_CreateWindow(ImGuiViewport* viewport) CAMetalLayer* layer = [CAMetalLayer layer]; layer.device = device; layer.framebufferOnly = YES; - layer.pixelFormat = bd->SharedMetalContext.framebufferDescriptor.colorPixelFormats[0]; + layer.pixelFormat = [bd->SharedMetalContext.framebufferDescriptor colorPixelFormatAtIndex:0]; #if TARGET_OS_OSX NSWindow* window = (__bridge NSWindow*)handle; NSView* view = window.contentView; diff --git a/backends/imgui_impl_metal4.mm b/backends/imgui_impl_metal4.mm index a042a1bcb..6c9603afc 100644 --- a/backends/imgui_impl_metal4.mm +++ b/backends/imgui_impl_metal4.mm @@ -840,7 +840,7 @@ static void ImGui_ImplMetal_CreateWindow(ImGuiViewport* viewport) CAMetalLayer* layer = [CAMetalLayer layer]; layer.device = device; layer.framebufferOnly = YES; - layer.pixelFormat = bd->SharedMetalContext.framebufferDescriptor.colorPixelFormats[0]; + layer.pixelFormat = [bd->SharedMetalContext.framebufferDescriptor colorPixelFormatAtIndex:0]; #if TARGET_OS_OSX NSWindow* window = (__bridge NSWindow*)handle; NSView* view = window.contentView;