MTLMain: Only compile NSView manipulation code on macOS
This commit is contained in:
parent
8ad7fa0313
commit
b32b27ae9a
|
@ -3,7 +3,10 @@
|
|||
|
||||
#include "VideoBackends/Metal/VideoBackend.h"
|
||||
|
||||
#if TARGET_OS_OSX
|
||||
#include <AppKit/AppKit.h>
|
||||
#endif
|
||||
|
||||
#include <Metal/Metal.h>
|
||||
#include <QuartzCore/QuartzCore.h>
|
||||
|
||||
|
@ -156,6 +159,7 @@ void Metal::VideoBackend::InitBackendInfo()
|
|||
|
||||
void Metal::VideoBackend::PrepareWindow(WindowSystemInfo& wsi)
|
||||
{
|
||||
#if TARGET_OS_OSX
|
||||
if (wsi.type != WindowSystemType::MacOS)
|
||||
return;
|
||||
NSView* view = static_cast<NSView*>(wsi.render_surface);
|
||||
|
@ -163,4 +167,5 @@ void Metal::VideoBackend::PrepareWindow(WindowSystemInfo& wsi)
|
|||
[view setWantsLayer:YES];
|
||||
[view setLayer:layer];
|
||||
wsi.render_surface = layer;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue