HatchitGraphics
ht_d3d12renderer.h
1 
15 #pragma once
16 
17 #include <ht_platform.h>
18 #include <ht_directx.h>
19 #include <ht_renderer.h>
20 #include <ht_d3d12vertexbuffer.h>
21 #include <ht_d3d12indexbuffer.h>
22 #include <ht_d3d12pipeline.h>
23 #include <ht_d3d12texture.h>
24 #include <ht_d3d12constantbuffer.h>
25 #include <ht_math.h>
26 #include <DirectXMath.h>
27 namespace Hatchit {
28 
29  namespace Graphics {
30 
31  namespace DX {
32 
33  struct _MM_ALIGN16 ConstantBuffer
34  {
35  Math::Matrix4 world;
36  Math::Matrix4 view;
37  Math::Matrix4 proj;
38  };
39 
40  class HT_API D3D12Renderer : public Graphics::Renderer
41  {
42  static const int NUM_BUFFER_FRAMES = 2;
43  public:
44  D3D12Renderer();
45 
46  ~D3D12Renderer();
47 
48  bool VInitialize(const RendererParams& params) override;
49 
50  void VDeInitialize() override;
51 
52  void VResizeBuffers(uint32_t width, uint32_t height) override;
53 
54  void VSetClearColor(const Color& color) override;
55 
56  void VClearBuffer(ClearArgs args) override;
57 
58  void VPresent() override;
59 
60  void VRender(float dt) override;
61 
62  private:
63  D3D12DeviceResources* m_resources;
64  uint32_t m_cbDescriptorSize;
65  D3D12PipelineHandle m_pipeline;
66  Color m_clearColor;
67 
68  //Demo only
69  float m_aspectRatio;
70  D3D12ConstantBuffer* m_cBuffer;
71 
72  D3D12VertexBuffer* m_vBuffer;
73  D3D12IndexBuffer* m_iBuffer;
74  size_t m_numIndices;
75  ConstantBuffer m_constantBufferData;
76 
77  void BuildMeshData();
78  };
79  }
80  }
81 }
Definition: ht_d3d12indexbuffer.h:27
Definition: ht_d3d12constantbuffer.h:27
Definition: ht_renderer.h:81
Definition: ht_d3d12renderer.h:40
Definition: ht_renderer.h:69
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.
Definition: ht_color.h:19
Color class defining a 4-component color value.
Definition: ht_color.h:26
Definition: ht_d3d12vertexbuffer.h:27
Definition: ht_d3d12types.h:28
Definition: ht_d3d12deviceresources.h:26