-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectXViewProvider.cpp
More file actions
61 lines (51 loc) · 1.79 KB
/
DirectXViewProvider.cpp
File metadata and controls
61 lines (51 loc) · 1.79 KB
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
61
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//// PARTICULAR PURPOSE.
////
//// Copyright (c) Microsoft Corporation. All rights reserved
#include "DirectXViewProvider.h"
#include "View.h"
using namespace Windows::ApplicationModel::Core;
using namespace Windows::UI::Core;
using namespace Windows::ApplicationModel::Activation;
DirectXViewProvider::DirectXViewProvider()
{
}
void DirectXViewProvider::Initialize(
_In_ Windows::ApplicationModel::Core::CoreApplicationView^ applicationView
)
{
m_applicationView = applicationView;
}
void DirectXViewProvider::SetWindow(_In_ Windows::UI::Core::CoreWindow^ window)
{
m_window = window;
}
// this method is called after Initialize
void DirectXViewProvider::Load(Platform::String^)
{
}
// this method is called after Load
void DirectXViewProvider::Run()
{
auto view = ref new View();
view->Initialize(m_window, m_applicationView);
view->Run();
// Must delete the view explicitly in order to break a circular dependency
// between View and CoreWindow. View holds on to a CoreWindow reference most
// typically for window activation, while CoreWindow refers back to View when
// event handlers are hooked up. Without breaking this circular dependency,
// neither View nor CoreWindow object gets to clean up. It's also important
// to note that a 'delete' call on a ref class instance simply means calling
// into a class destructor in order to explicitly break a cycle. It doesn't
// actually deallocate any memory.
delete view;
}
void DirectXViewProvider::Uninitialize()
{
}
IFrameworkView^ DirectXViewProviderFactory::CreateView()
{
return ref new DirectXViewProvider();
}