diff --git a/GW2Radial/include/Core.h b/GW2Radial/include/Core.h index 867580b..e3e534c 100644 --- a/GW2Radial/include/Core.h +++ b/GW2Radial/include/Core.h @@ -99,6 +99,8 @@ class Core : public Singleton ComPtr annotations_; + ComPtr backBufferRTV_; + RENDERDOC_API_1_5_0* rdoc_ = nullptr; }; } diff --git a/GW2Radial/src/Core.cpp b/GW2Radial/src/Core.cpp index 740f16e..0ebe993 100644 --- a/GW2Radial/src/Core.cpp +++ b/GW2Radial/src/Core.cpp @@ -144,13 +144,17 @@ LRESULT Core::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) void Core::PreResizeSwapChain() { - + backBufferRTV_.Reset(); } void Core::PostResizeSwapChain(uint w, uint h) { screenWidth_ = w; screenHeight_ = h; + + ComPtr backbuffer; + swc_->GetBuffer(0, IID_PPV_ARGS(backbuffer.GetAddressOf())); + device_->CreateRenderTargetView(backbuffer.Get(), nullptr, backBufferRTV_.ReleaseAndGetAddressOf()); } void Core::PostCreateSwapChain(HWND hwnd, ID3D11Device* device, IDXGISwapChain* swc) @@ -181,6 +185,10 @@ void Core::PostCreateSwapChain(HWND hwnd, ID3D11Device* device, IDXGISwapChain* context_->QueryInterface(annotations_.ReleaseAndGetAddressOf()); + ComPtr backbuffer; + swc_->GetBuffer(0, IID_PPV_ARGS(backbuffer.GetAddressOf())); + device_->CreateRenderTargetView(backbuffer.Get(), nullptr, backBufferRTV_.GetAddressOf()); + DXGI_SWAP_CHAIN_DESC desc; swc_->GetDesc(&desc); @@ -303,6 +311,8 @@ void Core::Draw() StateBackupD3D11 d3dstate; BackupD3D11State(context_.Get(), d3dstate); + context_->OMSetRenderTargets(1, backBufferRTV_.GetAddressOf(), nullptr); + // This is the closest we have to a reliable "update" function, so use it as one Input::i().OnUpdate();