-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDirectXPage.xaml.h
60 lines (47 loc) · 2.31 KB
/
DirectXPage.xaml.h
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
50
51
52
53
54
55
56
57
58
59
60
//
// DirectXPage.xaml.h
// Declaration of the DirectXPage class.
//
#pragma once
#include "DirectXPage.g.h"
#include "Common\DeviceResources.h"
#include "UWP_DX11Main.h"
namespace UWP_DX11
{
/// <summary>
/// A page that hosts a DirectX SwapChainPanel.
/// </summary>
public ref class DirectXPage sealed
{
public:
DirectXPage();
virtual ~DirectXPage();
void SaveInternalState(Windows::Foundation::Collections::IPropertySet^ state);
void LoadInternalState(Windows::Foundation::Collections::IPropertySet^ state);
private:
// XAML low-level rendering event handler.
void OnRendering(Platform::Object^ sender, Platform::Object^ args);
// Window event handlers.
void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
// DisplayInformation event handlers.
void OnDpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
void OnDisplayContentsInvalidated(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
// Other event handlers.
void AppBarButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void OnCompositionScaleChanged(Windows::UI::Xaml::Controls::SwapChainPanel^ sender, Object^ args);
void OnSwapChainPanelSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
// Track our independent input on a background worker thread.
Windows::Foundation::IAsyncAction^ m_inputLoopWorker;
Windows::UI::Core::CoreIndependentInputSource^ m_coreInput;
// Independent input handling functions.
void OnPointerPressed(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
void OnPointerMoved(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
void OnPointerReleased(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
// Resources used to render the DirectX content in the XAML page background.
std::shared_ptr<DX::DeviceResources> m_deviceResources;
std::unique_ptr<UWP_DX11Main> m_main;
bool m_windowVisible;
void Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
};
}