-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppearance.h
More file actions
45 lines (36 loc) · 923 Bytes
/
Copy pathAppearance.h
File metadata and controls
45 lines (36 loc) · 923 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
38
39
40
41
42
43
44
45
#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();
void Draw(ID3D11DeviceContext* pImmediateContext);
Geometry GetGeometryData() const { return mGeometry; }
Material GetMaterial() const { return mMaterial; }
//texturing
void SetTextureRV(ID3D11ShaderResourceView* textureRV) { mTextureRV = textureRV; }
ID3D11ShaderResourceView* GetTextureRV() const { return mTextureRV; }
bool HasTexture() const { return mTextureRV ? true : false; }
private:
Geometry mGeometry;
Material mMaterial;
ID3D11ShaderResourceView* mTextureRV;
};