-
Notifications
You must be signed in to change notification settings - Fork 0
/
Appearance.h
48 lines (35 loc) · 921 Bytes
/
Appearance.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
#pragma once
#include <directxmath.h>
#include <d3d11_1.h>
using namespace DirectX;
struct Geometry
{
ID3D11Buffer * vertexBuffer;
ID3D11Buffer * indexBuffer;
int numberOfIndices;
UINT vertexBufferStride;
UINT vertexBufferOffset;
};
struct Material
{
XMFLOAT4 diffuse;
XMFLOAT4 ambient;
XMFLOAT4 specular;
float specularPower;
};
class Appearance
{
public:
Appearance(Geometry geometry, Material material);
~Appearance();
Geometry GetGeometryData() const { return _geometry; }
Material GetMaterial() const { return _material; }
void SetTextureRV(ID3D11ShaderResourceView * textureRV) { _textureRV = textureRV; }
ID3D11ShaderResourceView * GetTextureRV() const { return _textureRV; }
bool HasTexture() const { return _textureRV ? true : false; }
void Draw(ID3D11DeviceContext * pImmediateContext);
private:
Geometry _geometry;
Material _material;
ID3D11ShaderResourceView * _textureRV;
};