forked from vixorien/D3D11Starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSkybox.h
53 lines (45 loc) · 1.36 KB
/
Skybox.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
48
49
50
51
52
#pragma once
#include <d3d11.h>
#include <wrl/client.h>
#include <memory>
#include <DirectXMath.h>
#include "SimpleShader.h"
#include "Camera.h"
#include "Mesh.h"
class Skybox
{
public:
Skybox(
const char* _name,
std::shared_ptr<Mesh> _mesh,
Microsoft::WRL::ComPtr<ID3D11SamplerState> _samplerState,
std::shared_ptr<SimpleVertexShader> _vertexShader,
std::shared_ptr<SimplePixelShader> _pixelShader,
std::wstring _pathBase
);
void Draw(std::shared_ptr<Camera> camera);
Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> GetSRV();
const char* GetName();
private:
// Helper for creating a cubemap from 6 individual textures
Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> CreateCubemap(
const wchar_t* right,
const wchar_t* left,
const wchar_t* up,
const wchar_t* down,
const wchar_t* front,
const wchar_t* back);
// Sampler options
Microsoft::WRL::ComPtr<ID3D11SamplerState> samplerState;
// Cube map texture's SRV
Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> srv;
// Depth buffer comparison type
Microsoft::WRL::ComPtr<ID3D11DepthStencilState> depthState;
// Switches to draw object's inside faces
Microsoft::WRL::ComPtr<ID3D11RasterizerState> rasterizerState;
// Internal name for ImGui
const char* name;
std::shared_ptr<Mesh> mesh;
std::shared_ptr<SimpleVertexShader> vertexShader;
std::shared_ptr<SimplePixelShader> pixelShader;
};