-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConstantBuffers.hpp
61 lines (44 loc) · 1.32 KB
/
ConstantBuffers.hpp
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
#ifndef CONSTANTBUFFERS_HPP
#define CONSTANTBUFFERS_HPP
#include <d3d11.h>
#include <d3dcompiler.h>
#include <DirectXMath.h>
#include "Globals.hpp"
//#include "Camera.hpp" // InitialiseConstantMatrices()
struct GSConstantDataMatrices ///Defining WHAT it is that's being sent to the Geometry Shader
{
DirectX::XMMATRIX world;
DirectX::XMMATRIX view;
DirectX::XMMATRIX projection;
DirectX::XMMATRIX RotationX270;
DirectX::XMMATRIX RotationY90;
DirectX::XMMATRIX FlipMatrixY;
};
struct GSConstantDataFloats
{
DirectX::XMFLOAT4X4 world;
DirectX::XMFLOAT4X4 view;
DirectX::XMFLOAT4X4 projection;
DirectX::XMFLOAT4X4 RotationX270;
DirectX::XMFLOAT4X4 RotationY90;
DirectX::XMFLOAT4X4 FlipMatrix;
};
void CreateSetConstantBuffers(
GSConstantDataFloats *ConstData,
ID3D11Device* *Device,
ID3D11DeviceContext* *DeviceContext,
ID3D11Buffer* *ConstantBuffer
);
// Does not initialise the ViewMatrix, since Camera.UpdateCamera() does this.
//
void InitializeConstantMatrices(GSConstantDataMatrices *constData); ///Parameters are HARDCODED for the matrices except for VIEWMATRIX
void MatrixToFloat4X4Reformat(
GSConstantDataMatrices *MatrixStruct,
GSConstantDataFloats &FloatsStruct
);
void AlterConstantBuffers(
ID3D11Buffer* TargetBuffer,
GSConstantDataFloats TargetStruct,
ID3D11DeviceContext* *DeviceContext
);
#endif