forked from microsoft/Xbox-ATG-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PanelScreen.cpp
113 lines (92 loc) · 2.21 KB
/
PanelScreen.cpp
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//--------------------------------------------------------------------------------------
// PanelScreen.cpp
//
// Advanced Technology Group (ATG)
// Copyright (C) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "PanelScreen.h"
#include "FrontPanelManager.h"
#include "StepTimer.h"
using namespace ATG;
PanelScreen::~PanelScreen()
{
m_owner = nullptr;
}
void PanelScreen::Update(DX::StepTimer const &)
{
}
void PanelScreen::OnNeighborsChanged()
{
}
bool PanelScreen::OnButtonPressed(XBOX_FRONT_PANEL_BUTTONS whichButton)
{
switch (whichButton)
{
default:
break;
case XBOX_FRONT_PANEL_BUTTONS_LEFT:
if (m_leftNeighbor)
{
m_leftNeighbor->Resume(this);
return true;
}
break;
case XBOX_FRONT_PANEL_BUTTONS_RIGHT:
if (m_rightNeighbor)
{
m_rightNeighbor->Resume(this);
return true;
}
break;
case XBOX_FRONT_PANEL_BUTTONS_UP:
if (m_upNeighbor)
{
m_upNeighbor->Resume(this);
return true;
}
break;
case XBOX_FRONT_PANEL_BUTTONS_DOWN:
if (m_downNeighbor)
{
m_downNeighbor->Resume(this);
return true;
}
break;
}
return false;
}
void PanelScreen::Resume(const PanelScreen *)
{
m_owner->Navigate(*this);
RenderFrontPanel();
}
void PanelScreen::CreateDeviceDependentResources(DX::DeviceResources *, IXboxFrontPanelControl *)
{
}
void PanelScreen::CreateWindowSizeDependentResources(DX::DeviceResources *)
{
}
void PanelScreen::GPURender(DX::DeviceResources *)
{
}
void PanelScreen::SetLeftNeighbor(PanelScreen * leftNeighbor)
{
m_leftNeighbor = leftNeighbor;
OnNeighborsChanged();
}
void PanelScreen::SetRightNeighbor(PanelScreen * rightNeighbor)
{
m_rightNeighbor = rightNeighbor;
OnNeighborsChanged();
}
void PanelScreen::SetUpNeighbor(PanelScreen * upNeighbor)
{
m_upNeighbor = upNeighbor;
OnNeighborsChanged();
}
void PanelScreen::SetDownNeighbor(PanelScreen * downNeighbor)
{
m_downNeighbor = downNeighbor;
OnNeighborsChanged();
}