-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCube.h
More file actions
38 lines (34 loc) · 893 Bytes
/
Copy pathCube.h
File metadata and controls
38 lines (34 loc) · 893 Bytes
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
#pragma once
#include "Graphics.h"
#include <vector>
class Cube
{
public:
Cube(Graphics& graphics);
~Cube();
void reset();
void draw();
void move(float x, float y, float z);
void rotate(float x, float y, float z);
void scale(float x, float y, float z);
struct cBufferMatrix
{
DirectX::XMMATRIX model;
DirectX::XMMATRIX modelViewProj;
};
private:
ID3D11Buffer* vertexBuffer = nullptr;
ID3D11Buffer* indexBuffer = nullptr;
ID3D11InputLayout* inputLayout = nullptr;
ID3D11Buffer* modelViewProj = nullptr;
ID3D11Device* device = nullptr;
ID3D11DeviceContext* context = nullptr;
cBufferMatrix cb;
ID3D11VertexShader* vs = nullptr;
ID3D11PixelShader* ps = nullptr;
ID3D11Debug* debug = nullptr;
DirectX::XMFLOAT3 position = { 0.0f, 0.0f, 0.0f };
DirectX::XMFLOAT3 rotation = { 0.0f, 0.0f, 0.0f };
DirectX::XMFLOAT3 scaling = { 1.0f, 1.0f, 1.0f };
UINT numIndices;
};