diff --git a/SpoutDX/source/SpoutCommon.h b/SpoutDX/source/SpoutCommon.h index 13a6b90..a58459b 100644 --- a/SpoutDX/source/SpoutCommon.h +++ b/SpoutDX/source/SpoutCommon.h @@ -78,7 +78,9 @@ // C++11 scoped (class) enums are not compatible with early compilers (< VS2012 and others). // The warning is designated "Prefer" and "C" standard unscoped enums are retained for compatibility. +#if defined(_MSC_VER) #pragma warning(disable:26812) // unscoped enums +#endif #endif diff --git a/SpoutDX/source/SpoutDX.cpp b/SpoutDX/source/SpoutDX.cpp index 1512b75..b3ce1b4 100644 --- a/SpoutDX/source/SpoutDX.cpp +++ b/SpoutDX/source/SpoutDX.cpp @@ -126,6 +126,8 @@ // 19.03.23 - Remove redundant CreateDX11StagingTexture and use SpoutDirectX function // ReceiveSenderData - create a DX11 receiving texture with compatible format // for unknown or DX9 formats. +// 21.03.23 - ReceiveSenderData - revert to using the format of the D3D11 texture +// generated by OpenDX11shareHandle for incorrect sender information. // // ==================================================================================== /* @@ -2117,12 +2119,10 @@ bool spoutDX::ReceiveSenderData() dxShareHandle = (HANDLE)(LongToHandle((long)info.shareHandle)); dwFormat = info.format; - // Create a DX11 receiving texture with compatible format - // for unknown or DX9 formats. - // 0 = unknown + // For DX9 sender formats, use a compatible DX11 format // 21 = D3DFMT_A8R8G8B8 // 22 = D3DFMT_X8R8G8B8 - if (dwFormat == 0 || dwFormat == 21 || dwFormat == 22) { + if (dwFormat == 21 || dwFormat == 22) { dwFormat = (DWORD)DXGI_FORMAT_B8G8R8A8_UNORM; } @@ -2186,6 +2186,11 @@ bool spoutDX::ReceiveSenderData() if (desc.Width == 0 || desc.Height == 0) return false; + // For incorrect sender information, use the format + // of the D3D11 texture generated by OpenDX11shareHandle + if (dwFormat != (DWORD)desc.Format) + dwFormat = (DWORD)desc.Format; + // Initialize again with the newly connected sender values CreateReceiver(sendername, width, height, dwFormat); diff --git a/SpoutDX/source/SpoutDirectX.cpp b/SpoutDX/source/SpoutDirectX.cpp index 45871b1..2d57420 100644 --- a/SpoutDX/source/SpoutDirectX.cpp +++ b/SpoutDX/source/SpoutDirectX.cpp @@ -628,8 +628,8 @@ bool spoutDirectX::CreateDX11Texture(ID3D11Device* pd3dDevice, ReleaseDX11Texture(pd3dDevice, *ppTexture); // Use the format passed in - // If that is zero or DX9 format, use the default format DXGI_FORMAT texformat = format; + // If that is zero or DX9 format, use the default format if (format == 0 || format == 21 || format == 22) // D3DFMT_A8R8G8B8 = 21 D3DFMT_X8R8G8B8 = 22 texformat = DXGI_FORMAT_B8G8R8A8_UNORM; @@ -695,8 +695,8 @@ bool spoutDirectX::CreateDX11StagingTexture(ID3D11Device* pd3dDevice, ID3D11Texture2D* pTexture = nullptr; // The new texture pointer // Use the format passed in - // If that is zero or DX9 format, use the default format DXGI_FORMAT texformat = format; + // If that is zero or DX9 format, use the default format if (format == 0 || format == 21 || format == 22) // D3DFMT_A8R8G8B8 = 21 D3DFMT_X8R8G8B8 = 22 texformat = DXGI_FORMAT_B8G8R8A8_UNORM; diff --git a/SpoutDX/source/SpoutUtils.cpp b/SpoutDX/source/SpoutUtils.cpp index 406f557..25a7878 100644 --- a/SpoutDX/source/SpoutUtils.cpp +++ b/SpoutDX/source/SpoutUtils.cpp @@ -123,6 +123,7 @@ Remove dll build warning MessageBox. Change "ConPrint" to "_conprint" and use Writefile instead of cout. 18.01.23 - _conprint - cast WriteFile size argument to DWORD + 19.03.23 - Update SDKversion to 2.007.010 */ @@ -170,7 +171,7 @@ namespace spoututils { // Spout SDK version number string // Major, minor, release - std::string SDKversion = "2.007.009"; + std::string SDKversion = "2.007.010"; // // Group: Information diff --git a/binaries/SPOUTCAM/SpoutCam32/SpoutCam32.ax b/binaries/SPOUTCAM/SpoutCam32/SpoutCam32.ax index 81a65e4..a711314 100644 Binary files a/binaries/SPOUTCAM/SpoutCam32/SpoutCam32.ax and b/binaries/SPOUTCAM/SpoutCam32/SpoutCam32.ax differ diff --git a/binaries/SPOUTCAM/SpoutCam64/SpoutCam64.ax b/binaries/SPOUTCAM/SpoutCam64/SpoutCam64.ax index 0f21374..aeb52f9 100644 Binary files a/binaries/SPOUTCAM/SpoutCam64/SpoutCam64.ax and b/binaries/SPOUTCAM/SpoutCam64/SpoutCam64.ax differ diff --git a/source/cam.cpp b/source/cam.cpp index c5fefa7..70c5d97 100644 --- a/source/cam.cpp +++ b/source/cam.cpp @@ -290,7 +290,8 @@ 17.03.23 SpoutDX ReceiveSenderData. Allow for applications that do not fill the sender information format field. If no format is specified use a valid D3D11 texture format. - 19.03.23 Rebuild x86/x64 VS2022 /MT with updated SpoutDX. + 21.03.23 Update SpoutGL and SpoutDX files + Rebuild x86/x64 VS2022 /MT Version 2.027