-
Notifications
You must be signed in to change notification settings - Fork 16
/
UILayer.h
68 lines (59 loc) · 1.82 KB
/
UILayer.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
61
62
63
64
65
66
67
68
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
#pragma once
#include "D3D12SM6WaveIntrinsics.h"
using Microsoft::WRL::ComPtr;
class UILayer
{
public:
UILayer(D3D12SM6WaveIntrinsics* pSample);
void UpdateLabels(UINT selectedRenderMode=1);
void Render();
void ReleaseResources();
void Resize();
private:
struct TextBlock
{
std::wstring text;
D2D1_RECT_F layout;
IDWriteTextFormat* pFormat;
};
enum Labels
{
RenderModeSelection = 0,
RenderMode1,
RenderMode2,
RenderMode3,
RenderMode4,
RenderMode5,
RenderMode6,
RenderMode7,
RenderMode8,
RenderMode9,
LabelCount
};
D3D12SM6WaveIntrinsics* m_pSample;
ComPtr<ID3D11DeviceContext> m_d3d11DeviceContext;
ComPtr<ID3D11On12Device> m_d3d11On12Device;
ComPtr<IDWriteFactory> m_dWriteFactory;
ComPtr<ID2D1Factory3> m_d2dFactory;
ComPtr<ID2D1Device2> m_d2dDevice;
ComPtr<ID2D1DeviceContext2> m_d2dDeviceContext;
ComPtr<ID3D11Resource> m_wrappedRenderTarget;
ComPtr<ID2D1Bitmap1> m_d2dRenderTarget;
ComPtr<ID2D1SolidColorBrush> m_textBrush;
ComPtr<IDWriteTextFormat> m_textFormat;
ComPtr<IDWriteTextFormat> m_textLayout;
std::vector<std::wstring> m_labels;
std::vector<TextBlock> m_textBlocks;
UINT m_selectedRenderMode;
void Initialize();
};