Procházet zdrojové kódy

libobs-d3d11: Include GDI surface in rebuild

The GDI surface was not included in the rebuild process, therefore when
window capture is used, it would cause a crash after a rebuild.
jp9000 před 9 roky
rodič
revize
bd5de5d938
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. 7 0
      libobs-d3d11/d3d11-rebuild.cpp

+ 7 - 0
libobs-d3d11/d3d11-rebuild.cpp

@@ -53,6 +53,13 @@ inline void gs_texture_2d::Rebuild(ID3D11Device *dev)
 
 	if (isRenderTarget)
 		InitRenderTargets();
+
+	if (isGDICompatible) {
+		hr = texture->QueryInterface(__uuidof(IDXGISurface1),
+				(void**)&gdiSurface);
+		if (FAILED(hr))
+			throw HRError("Failed to create GDI surface", hr);
+	}
 }
 
 inline void gs_zstencil_buffer::Rebuild(ID3D11Device *dev)