mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
WgpuMetalSurface_mac: switch to <AppKit/AppKit.h> umbrella
The narrow `<AppKit/NSView.h>` header only forward-declares NSWindow,
so `view.window.backingScaleFactor` fails to compile on macOS with:
error: property 'backingScaleFactor' cannot be found in forward
class object 'NSWindow'
Use the AppKit umbrella header so NSWindow's interface (including
backingScaleFactor) is in scope. Same idiomatic include any non-trivial
Cocoa code reaches for; we're already linking -framework Cocoa so
there's no compile-time cost beyond a slightly heavier translation
unit (the .mm is ~30 lines anyway).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,10 @@
|
||||
|
||||
#if defined(__APPLE__)
|
||||
|
||||
#import <AppKit/NSView.h>
|
||||
// The AppKit umbrella header pulls in NSWindow so `view.window`'s
|
||||
// `backingScaleFactor` resolves — `<AppKit/NSView.h>` alone only
|
||||
// forward-declares NSWindow.
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <QuartzCore/CAMetalLayer.h>
|
||||
|
||||
void* wgpu_macos_attach_metal_layer(void* nsview_ptr) {
|
||||
|
||||
Reference in New Issue
Block a user