forked from MonoGame/MonoGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GraphicsDeviceManager.WinRT.cs
49 lines (42 loc) · 1.48 KB
/
GraphicsDeviceManager.WinRT.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
using System;
using Microsoft.Xna.Framework.Graphics;
#if WINDOWS_STOREAPP || WINDOWS_UAP
using Windows.UI.Xaml.Controls;
#endif
namespace Microsoft.Xna.Framework
{
partial class GraphicsDeviceManager
{
#if WINDOWS_STOREAPP
[CLSCompliant(false)]
public SwapChainBackgroundPanel SwapChainBackgroundPanel { get; set; }
#endif
#if WINDOWS_UAP
[CLSCompliant(false)]
public SwapChainPanel SwapChainPanel { get; set; }
#endif
partial void PlatformInitialize(PresentationParameters presentationParameters)
{
#if WINDOWS_UAP
presentationParameters.DeviceWindowHandle = IntPtr.Zero;
presentationParameters.SwapChainPanel = this.SwapChainPanel;
#elif WINDOWS_STOREAPP
// The graphics device can use a XAML panel or a window
// to created the default swapchain target.
if (SwapChainBackgroundPanel != null)
{
presentationParameters.DeviceWindowHandle = IntPtr.Zero;
presentationParameters.SwapChainBackgroundPanel = this.SwapChainBackgroundPanel;
}
else
{
presentationParameters.DeviceWindowHandle = _game.Window.Handle;
presentationParameters.SwapChainBackgroundPanel = null;
}
#endif
}
}
}