This repository was archived by the owner on Jun 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStructures.h
More file actions
93 lines (75 loc) · 1.71 KB
/
Copy pathStructures.h
File metadata and controls
93 lines (75 loc) · 1.71 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
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
#pragma once
#include <d3d11_1.h>
#include <directxmath.h>
using namespace DirectX;
//these structures were brought over from OBJLoader
struct MeshData
{
ID3D11Buffer* VertexBuffer;
ID3D11Buffer* IndexBuffer;
UINT VBStride;
UINT VBOffset;
UINT IndexCount;
MeshData() {};
MeshData(ID3D11Buffer* newVertexBuffer, ID3D11Buffer* newIndexBuffer, UINT newVBStride, UINT newVBOffset, UINT newIndexCount) {
VertexBuffer = newVertexBuffer;
IndexBuffer = newIndexBuffer;
VBStride = newVBStride;
VBOffset = newVBOffset;
IndexCount = newIndexCount;
}
};
struct SimpleVertex
{
XMFLOAT3 Pos;
XMFLOAT3 Normal;
XMFLOAT2 TexC;
bool operator<(const SimpleVertex other) const
{
return memcmp((void*)this, (void*)&other, sizeof(SimpleVertex)) > 0;
};
};
struct FogSettings
{
XMFLOAT4 fogColor;
FLOAT fogStart;
FLOAT fogRange;
};
//this structure was written to encapsulate the constant buffer
struct ConstantBuffer
{
XMMATRIX mWorld;
XMMATRIX mView;
XMMATRIX mProjection;
XMFLOAT4 AmbLight;
XMFLOAT4 AmbMat;
XMFLOAT4 SpecMat;
XMFLOAT4 SpecLight;
XMFLOAT3 EyeLoc;
FLOAT SpecPower;
XMFLOAT4 DiffLight;
XMFLOAT4 DiffMat;
XMFLOAT3 DirToLight;
FLOAT FogStart;
XMFLOAT4 FogColor;
FLOAT FogRange;
};
//structure to provide light colours and strength with, a shared feature across all light types.
struct LightData
{
XMFLOAT4 diffuseMat;
XMFLOAT4 diffuseStr;
XMFLOAT4 ambientMat;
XMFLOAT4 ambientStr;
XMFLOAT4 specularMat;
XMFLOAT4 specularStr;
FLOAT specularPow;
XMFLOAT3 dir;
};
//structure to contain a transform in its simple euler form rather than the world matrix result
struct Transform
{
XMFLOAT3 position;
XMFLOAT3 rotation;
XMFLOAT3 scale = XMFLOAT3(1.0f, 1.0f, 1.0f); //default of 1 scale
};