mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-04 15:19:09 +00:00
MTLMain: Only compile NSView manipulation code on macOS
This commit is contained in:
parent
8ad7fa0313
commit
b32b27ae9a
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue