mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
MTLMain: Only compile NSView manipulation code on macOS
This commit is contained in:
@ -3,7 +3,10 @@
|
|||||||
|
|
||||||
#include "VideoBackends/Metal/VideoBackend.h"
|
#include "VideoBackends/Metal/VideoBackend.h"
|
||||||
|
|
||||||
|
#if TARGET_OS_OSX
|
||||||
#include <AppKit/AppKit.h>
|
#include <AppKit/AppKit.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <Metal/Metal.h>
|
#include <Metal/Metal.h>
|
||||||
#include <QuartzCore/QuartzCore.h>
|
#include <QuartzCore/QuartzCore.h>
|
||||||
|
|
||||||
@ -156,6 +159,7 @@ void Metal::VideoBackend::InitBackendInfo()
|
|||||||
|
|
||||||
void Metal::VideoBackend::PrepareWindow(WindowSystemInfo& wsi)
|
void Metal::VideoBackend::PrepareWindow(WindowSystemInfo& wsi)
|
||||||
{
|
{
|
||||||
|
#if TARGET_OS_OSX
|
||||||
if (wsi.type != WindowSystemType::MacOS)
|
if (wsi.type != WindowSystemType::MacOS)
|
||||||
return;
|
return;
|
||||||
NSView* view = static_cast<NSView*>(wsi.render_surface);
|
NSView* view = static_cast<NSView*>(wsi.render_surface);
|
||||||
@ -163,4 +167,5 @@ void Metal::VideoBackend::PrepareWindow(WindowSystemInfo& wsi)
|
|||||||
[view setWantsLayer:YES];
|
[view setWantsLayer:YES];
|
||||||
[view setLayer:layer];
|
[view setLayer:layer];
|
||||||
wsi.render_surface = layer;
|
wsi.render_surface = layer;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user