-
Notifications
You must be signed in to change notification settings - Fork 0
/
stdafx.h
94 lines (74 loc) · 3.66 KB
/
stdafx.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
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
#pragma once
#include <SDKDDKVer.h>
#define WIN32_LEAN_AND_MEAN
#define DXGE_FRAME_COUNT 2
#define DXGE_WINDOW_DEFAULT_WIDTH 1280
#define DXGE_WINDOW_DEFAULT_HEIGHT 720
#include "windows.h"
#include "resource.h"
#include <string>
#include <cstring>
#include <vector>
#include <d3d12.h>
#include <dxgi1_4.h>
#include <initguid.h>
#include <dxgidebug.h>
#include <D3Dcompiler.h>
#include <DirectXMath.h>
#include <directxcollision.h>
#include <directxpackedvector.h>
#include "d3dx12.h"
#include <wincodec.h>
#include <wrl.h>
#include <shellapi.h>
#pragma comment(lib,"d3d12.lib")
#pragma comment(lib,"dxgi.lib")
#pragma comment(lib,"d3dcompiler.lib")
#pragma comment(lib,"windowscodecs.lib")
using Microsoft::WRL::ComPtr;
using namespace DirectX;
#include "Log.h"
struct Vertex {
XMFLOAT3 position;
XMFLOAT4 color;
XMFLOAT2 texcoord;
bool operator==(const Vertex& obj) {
if (position.x != obj.position.x) {
return false;
}
if (position.y != obj.position.y) {
return false;
}
if (position.z != obj.position.z) {
return false;
}
if (color.w != obj.color.w) {
return false;
}
if (color.x != obj.color.x) {
return false;
}
if (color.y != obj.color.y) {
return false;
}
if (color.z != obj.color.z) {
return false;
}
if (texcoord.y != obj.texcoord.y) {
return false;
}
if (texcoord.x != obj.texcoord.x) {
return false;
}
return true;
}
};
struct ConstantBuffer {
XMFLOAT4 factor;
XMFLOAT4X4 wvpMat;
};
#define THM_GREEN { 0.502f, 0.729f, 0.141f, 1.0f }
#define THM_GREY { 0.29f, 0.361f, 0.4f, 1.0f}
#define THM_RED { 0.612f, 0.075f, 0.177f, 1.0f}
#define WHITE {1.0f, 1.0f, 1.0f, 1.0f}
#define STR(x) std::to_string( x )