From 48df329411413836c1e38788e0d8131a5dd61300 Mon Sep 17 00:00:00 2001 From: Miguel Borges de Freitas <92enen@gmail.com> Date: Mon, 17 Jun 2024 11:03:53 +0100 Subject: [PATCH] Win: Make sure background is black --- src/Pyro.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Pyro.cpp b/src/Pyro.cpp index b1657c1..eff5627 100644 --- a/src/Pyro.cpp +++ b/src/Pyro.cpp @@ -204,6 +204,12 @@ static int myrand() void CScreensaverPyro::Render() { #ifdef WIN32 + ID3D11RenderTargetView* renderTargetView; + m_pContext->OMGetRenderTargets(1, &renderTargetView, nullptr); + float clearColor[4] = { 0.0f, 0.0f, 0.0f, 1.0f }; + m_pContext->ClearRenderTargetView(renderTargetView, clearColor); + SAFE_RELEASE(renderTargetView); + m_pContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); UINT strides = sizeof(MYCUSTOMVERTEX), offsets = 0; m_pContext->IASetVertexBuffers(0, 1, &m_pVBuffer, &strides, &offsets);