-
Notifications
You must be signed in to change notification settings - Fork 0
/
TriangleRenderer.h
36 lines (27 loc) · 1.44 KB
/
TriangleRenderer.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
#pragma once
#include "Renderer.h"
class TriangleRenderer :
public Renderer {
public:
TriangleRenderer() {};
~TriangleRenderer() {};
bool CreatePipelineState(ComPtr<ID3D12Device>&, int width, int height) override;
bool LoadResources(ComPtr<ID3D12Device>& device, ComPtr<ID3D12GraphicsCommandList>& command_list,
ComPtr<ID3D12CommandAllocator>& command_allocator, int width, int height) override;
bool PopulateCommandList(ComPtr<ID3D12GraphicsCommandList>& command_list,
ComPtr<ID3D12CommandAllocator>& command_allocator, CD3DX12_CPU_DESCRIPTOR_HANDLE& rtv_handle,
ComPtr<ID3D12Resource>& render_target, int frame_index) override;
void Release() override;
protected:
CD3DX12_VIEWPORT m_viewport_;
CD3DX12_RECT m_scissor_rect_;
ComPtr<ID3D12RootSignature> m_root_signature_;
ComPtr<ID3D12PipelineState> m_pipeline_state_;
ComPtr<ID3D12Resource> m_vertex_buffer_;
D3D12_VERTEX_BUFFER_VIEW m_vertex_buffer_view_;
virtual bool CreateVertexBuffer(ComPtr<ID3D12Device>& device, ComPtr<ID3D12GraphicsCommandList>& command_list,
Vertex* v_list, int vertex_buffer_size);
virtual bool CreateRootSignature(ComPtr<ID3D12Device>& device);
virtual bool CompileShaders(ComPtr<ID3DBlob>& vertex_shader, LPCSTR entry_point_vertex_shader,
ComPtr<ID3D10Blob>& pixel_shader, LPCSTR entry_point_pixel_shader);
};