forked from duchuule/vba10
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSample3DSceneRenderer.h
50 lines (41 loc) · 1.46 KB
/
Sample3DSceneRenderer.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
#pragma once
#include "..\Common\DeviceResources.h"
#include "ShaderStructures.h"
#include "..\Common\StepTimer.h"
namespace VBA10
{
// This sample renderer instantiates a basic rendering pipeline.
class Sample3DSceneRenderer
{
public:
Sample3DSceneRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources);
void CreateDeviceDependentResources();
void CreateWindowSizeDependentResources();
void ReleaseDeviceDependentResources();
void Update(DX::StepTimer const& timer);
void Render();
void StartTracking();
void TrackingUpdate(float positionX);
void StopTracking();
bool IsTracking() { return m_tracking; }
private:
void Rotate(float radians);
private:
// Cached pointer to device resources.
std::shared_ptr<DX::DeviceResources> m_deviceResources;
// Direct3D resources for cube geometry.
Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout;
Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer;
Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer;
Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader;
Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader;
Microsoft::WRL::ComPtr<ID3D11Buffer> m_constantBuffer;
// System resources for cube geometry.
ModelViewProjectionConstantBuffer m_constantBufferData;
uint32 m_indexCount;
// Variables used with the rendering loop.
bool m_loadingComplete;
float m_degreesPerSecond;
bool m_tracking;
};
}