[D3D12] Rename D3D12Provider getters

This commit is contained in:
Triang3l 2018-07-19 14:52:54 +03:00
parent f5e91ba97c
commit 14bfac3ebd
2 changed files with 11 additions and 13 deletions

View File

@ -25,9 +25,9 @@ D3D12Context::~D3D12Context() { Shutdown(); }
bool D3D12Context::Initialize() {
auto provider = static_cast<D3D12Provider*>(provider_);
auto dxgi_factory = provider->get_dxgi_factory();
auto device = provider->get_device();
auto direct_queue = provider->get_direct_queue();
auto dxgi_factory = provider->GetDXGIFactory();
auto device = provider->GetDevice();
auto direct_queue = provider->GetDirectQueue();
context_lost_ = false;
@ -57,7 +57,7 @@ bool D3D12Context::Initialize() {
swap_chain_desc.Flags = 0;
IDXGISwapChain1* swap_chain_1;
if (FAILED(dxgi_factory->CreateSwapChainForHwnd(
provider->get_direct_queue(),
provider->GetDirectQueue(),
static_cast<HWND>(target_window_->native_handle()), &swap_chain_desc,
nullptr, nullptr, &swap_chain_1))) {
XELOGE("Failed to create a DXGI swap chain");

View File

@ -29,16 +29,14 @@ class D3D12Provider : public GraphicsProvider {
Window* target_window) override;
std::unique_ptr<GraphicsContext> CreateOffscreenContext() override;
IDXGIFactory2* get_dxgi_factory() const { return dxgi_factory_; }
ID3D12Device* get_device() const { return device_; }
ID3D12CommandQueue* get_direct_queue() const { return direct_queue_; }
IDXGIFactory2* GetDXGIFactory() const { return dxgi_factory_; }
ID3D12Device* GetDevice() const { return device_; }
ID3D12CommandQueue* GetDirectQueue() const { return direct_queue_; }
uint32_t get_descriptor_size_view() const { return descriptor_size_view_; }
uint32_t get_descriptor_size_sampler() const {
return descriptor_size_sampler_;
}
uint32_t get_descriptor_size_rtv() const { return descriptor_size_rtv_; }
uint32_t get_descriptor_size_dsv() const { return descriptor_size_dsv_; }
uint32_t GetDescriptorSizeView() const { return descriptor_size_view_; }
uint32_t GetDescriptorSizeSampler() const { return descriptor_size_sampler_; }
uint32_t GetDescriptorSizeRTV() const { return descriptor_size_rtv_; }
uint32_t GetDescriptorSizeDSV() const { return descriptor_size_dsv_; }
private:
explicit D3D12Provider(Window* main_window);