forked from vixorien/D3D11Starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMaterial.h
More file actions
36 lines (28 loc) · 1.12 KB
/
Copy pathMaterial.h
File metadata and controls
36 lines (28 loc) · 1.12 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
#pragma once
#include "SimpleShader.h"
#include <memory>
#include <unordered_map>
class Material
{
public:
Material(
DirectX::XMFLOAT4 colorTint,
std::shared_ptr<SimpleVertexShader> vs,
std::shared_ptr<SimplePixelShader> ps
);
DirectX::XMFLOAT4 GetColorTint();
std::shared_ptr<SimpleVertexShader> GetVS();
std::shared_ptr<SimplePixelShader> GetPS();
DirectX::XMFLOAT4 SetColorTint(DirectX::XMFLOAT4 newColorTint);
std::shared_ptr<SimpleVertexShader> SetVS(std::shared_ptr<SimpleVertexShader> newVS);
std::shared_ptr<SimplePixelShader> SetPS(std::shared_ptr<SimplePixelShader> newPS);
void PrepareMaterial();
void AddTextureSRV(std::string shaderName, Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> srv);
void AddTextureSampler(std::string shaderName, Microsoft::WRL::ComPtr<ID3D11SamplerState> sampState);
private:
DirectX::XMFLOAT4 colorTint;
std::shared_ptr<SimpleVertexShader> vs;
std::shared_ptr<SimplePixelShader> ps;
std::unordered_map<std::string, Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>> textureSRVs;
std::unordered_map<std::string, Microsoft::WRL::ComPtr<ID3D11SamplerState>> textureSamplers;
};